Are there any MySQL queries that can help me retrieve x
recent entries from a table having z
total rows such that I can keep a take-off point y
, where 0 <= x <= y <= z
?
Actually its for pagination of information from a database, for example when a user hits the next button, the next most recent 5 (which is x
here) posts, from newer to older posts, show each time the button is clicked.
I actually wrote a working algorithm using basic SELECT
, UPDATE
and loops for this but I am curious if there is a more efficient way.