I made a Randompicker where 10 users are selected randomly and added to a database table called "winners". Every time I click on my button 10 winners are getting selected and added to the table. I'm able to get the last 10 winners with a simple sql query.
SELECT * from winners order by id desc limit 10;
I use Ajax and print out the 10 rows as a table. The next step would be adding a "Previous" and "Next" button. If I click on the "Previous" Button I need to get the "second latest" 10 winners. What kind of a query would be needed? The button will be clickable until the oldest 10 winners are getting shown.
The winners table structure looks like this:
NR USERID USERNAME DATE
I can't figure out how to do that.