I have a php script that collects producs from a mysql database. It uses a while loop to display all of the results. How can I make it so that it only displays 10 listing at a time? Then as the user clicks "next" it displays the next ten?
SELECT * FROM table LIMIT 0,10 DESC
next 10
SELECT * FROM table LIMIT 10,20 DESC
can I make some sort of loop that does that automatically, instead of me having to physically make another piece of code for each page? I mean there could be hundreds of items in each category.
youurl.com/file.php?page=5
$start=$page*10; $end=$start+10; $res=mysql_query("SELECT * FROM TABLE LIMIT $start,$end DESC");
Hi
there is a very good article on this site about "prev/next" buttons. Take a look at it as ity does exactly what you are looking to do
Regards
Gary Mailer