How to get the "Next" button on a webpage in PHP and MySQL
Hi,
I have a table full of stuff which I want to print on screen 5 at a time, with a "next" button for the next page - how do I do this? The list for each page is obtained with a: SELECT NAME FROM table LIMIT $start, 5; which is simple enough, then I think I need to do a : SELECT count (*) FROM table ;, and check if there will BE a "next" page, and then generate the link for that at the bottom of the page - how do I do this? Thanks. |
Send the $start as a GET variable in the URL, so your link will be something like: www.mydomain.com/list.php?start=16
Then in the $_GET superglobal array will be an element with the key 'start' |
All times are GMT -5. The time now is 02:22 AM. |