LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to get the "Next" button on a webpage in PHP and MySQL (https://www.linuxquestions.org/questions/programming-9/how-to-get-the-next-button-on-a-webpage-in-php-and-mysql-786609/)

resetreset 02-03-2010 02:53 AM

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.

graemef 02-03-2010 03:31 AM

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.