Is there any way to check if any rows left for the next LIMIT query (for showing Next Page link)? I don't want COUNT(), extra SELECT, etc I use Limit a,b for getting each pages's posts.
Thanks!
Is there any way to check if any rows left for the next LIMIT query (for showing Next Page link)? I don't want COUNT(), extra SELECT, etc I use Limit a,b for getting each pages's posts.
Thanks!
You can use LIMIT N+1
in your query (where N is the actual limit). If the query returns N+1 rows, there are further pages; otherwise, you're on the last page. Of course this will require adjustments in other parts of your code, to omit the last row from the results displayed.