I have a really large data set from SQL that i need to paginate.
I have an issue with my pagination code. The code does show the page number in the URL
Using OFFSET
and LIMIT
for pagination of web pages leads to two bugs -- duplicated rows shown, and rows not shown.
Why?
INSERTed
or DELETEd
that belongs in the first 10.[Next]
and go to the page that shows the next 10 rows. But wait, it is not showing the "next" 10 rows, it is showing rows #11-20. And, since something changed in rows 1-10, the rows are not really continuing where you left off.I just gave you a hint of how to avoid it -- "remember where you left off" instead of using OFFSET
. More .