I will do a project for my database class (new in databases). I will use php. The tables are created in mysql. I have to display a webpage with some information:
attr1 | atrr2 | atrr3 | atrr4
| | |
| | |
But I want to display the last inserted 20 rows. Then, if the user wants to see the other rows inserted, the webpage will have a next page button showing the following 20 rows (not the same ones).
I know that I can use something like:
select (attributes) from tbl ORDER BY 'ID' DESC LIMIT 20
1- But then, How I can retrieve (with php programming) the other 20 rows? If I use the same query it will display the same information.
2- I was thinking to just query all the data and somehow store it, but I don't know if it is a good choice to store all the data even if the user does not want to see it. I want to do it as my first question because I have to retrieve other information from other tables in the database.
What do you suggest? And how I can retrieve the data as I want in my first question?