I am making an infinite scroll app in which records from database will be fetch. When the user clicks "Load More" button a function is called for retrieving data from database.
My problem is that when I am running this(below) query every Time I am getting the same records.
SELECT ArticleTitle, PreviewText, PreviewImage FROM Articles ORDER BY ID DESC LIMIT 4
regards....
load more
, you need to get offset, calculate next batch and update offset in same hidden fieldyour query looks like
SELECT ArticleTitle, PreviewText, PreviewImage
FROM Articles
ORDER BY ID DESC
LIMIT 0, 4
first time offset is 0
next time it will be 5 (if you are loading 5 records every time)
then next time it will be 10 and so on