Hi, I have a database that contains 35 record.
How do I split the data over multiple pages, whilst display a maximum of 5 records per page, at the same time of supplying page number links on each page, to enable the user to access the remaining records?
Example:
Display Record 1
Display Record 2
Display Record 3
Display Record 4
Display Record 5
Put “Limit 0,5” on the end of the Mysql query. That’ll show results from 0 to 5.
If you put “Limit 10,5” on the end of the query, It’ll show results from 10 to 15.
Look up Pagination, there are many resources to choose from.
On top of what arkinstall has already stated… Google “php paging” or “php pagination”… should yield some good results… In fact, I think Sitepoint has a few good articles about this… Here is one that talks about OOP paging towards end of article.
I came across the following code on the forums, posted by a user call TicTac.
How do I add numbered links to the script to represent the different available pages the user could navigate to.
Currently his/her script only consists of next and previous buttons.
Obviously, I need to change a few details in this script, in order for it to work for me.