I have an PHP (5.5) webapp with sqlite 3. It has an logs page (possibly 10k to 100k logs in the future). I am using this way of paging for those logs. The query for sqlite I am using:
SELECT *
FROM Logs
WHERE date > [input epoch long]
ORDER BY date DESC
LIMIT 100;
The logs model is like:
"id": [int increased by sqlite]
"date":[entry date, epoch long like: "1533595828"]
+ other not relevant data for this issue
I ideally want to have an page Like: Previous | 1 | 2 | 3 | 4 | Next, this seams pretty hard. So an Previous and Next page handling is acceptable.
For the Next page handling, I am using: date > [the last record it returned at init]. This works. Bud to go back I need to keep track of the first date. After I go back multiple times, this gets messy.
What would be the best way to solve this problem?