Lets say I have 5000 rows in my database. I want to paginate through the results, but I only want to paginate through the last 1000 rows, not all 5000. How would I do that? I would have a query like this:
SELECT SQL_CALC_FOUND_ROWS * FROM table LIMIT 0,25
But this query would grab all 5000 results. I just want to grab the latest 1000 results and paginate through that. How would I do this? I do have an id field that is a primary key, auto increment. Dont know if that would help.
If you want to use SQL for the pagination you need to call these queries in succession:
In other words