I am looking for a way to make my database display in parts. That is, first the first 10 rows, when pressing a button, perform a query with the other 10, and so on until the end. I have searched the internet and only found the LIMIT clause, which allows me to display the top 10. But from there, how do I get it to show me the 10 that follow?
According to the documentation for
MYSQL
, you can pass two arguments toLIMIT
where the first indicates the distance to the first record in your table and the second the number of records.In your particular case it would be:
Creating a pagination is more feasible much better this way you can show 10 products and then show 10 more and so on until you reach the end of the database records.