prev page, next page

From: Date: Fri, 30 Jun 2000 13:35:55 +0000
Subject: prev page, next page
Groups: php.general 
Request: Send a blank email to php-general+get-4019@lists.php.net to get a copy of this message
I want to create a "prev page" "next page" functionality... [thread from PHP-DB] > If you remove the LIMIT 0,5 from your query you will get all of > the rows by > using mysql_num_rows. Since you have LIMIT 0,5 on their now, 5 rows are > returned from the query, thus there are 5 rows in your result set (hence, > the 5 returned from mysql_num_rows). Do I really need to make two queries to obtain the number of rows for SELECT * FROM tblArtikel ORDER BY artID maxrows = mysql_num_rows to know when to stop when iterating with SELECT * FROM tblArtikel ORDER BY artID LIMIT 0,5 <next button> SELECT * FROM tblArtikel ORDER BY artID LIMIT 5,5 <next button> SELECT * FROM tblArtikel ORDER BY artID LIMIT 10,5 ... -- Torsten

« previous php.general (#4019) next »