Reputation:
I have this query
$query_return = database::query("SELECT * FROM tw ORDER BY time DESC");
that pulls all the rows, however I only want the top x=8 rows.
How do I modify it?
Thanks!
Upvotes: 0
Views: 78
Reputation: 9874
Add a limit clause:
$query_return = database::query("SELECT * FROM tw ORDER BY time DESC LIMIT 8");
Upvotes: 3