I will explain the basic logic behind the pagination.
- Find the total number of items
- How many items do you want to show on one page
- Then divide total number of items by items per page to get the total number of pages
- Call a function on next and prev buttons to fetch the relevant items. If you are using MySQL query to fetch data. You can use LIMIT option in query to fetch the desired records.
These are basic steps, however, I will recommend you to use some tested script for this purpose. Otherwise, you need to handle all the possible scenarios which will be really complex for you.
solved How to pagination [closed]