multiple pages for large result sets
| From: | mike at wkla dot com | Date: | Wed, 30 Jan 2002 01:48:59 +0000 |
| Subject: | multiple pages for large result sets | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-16288@lists.php.net to get a copy of this message | ||
Hello,
I have this query:
if ($cat){
$result = mysql_query("SELECT * FROM table WHERE $cat=1",$db);
if ($myrow = mysql_fetch_array($result)); {
do {
I use a link on the menu to call this query(<a href=browse.php?cat=food>)
This returns a large result set that I would like to span accross multiple
pages.
I've gotten this off this list and used it with success on other pages:
if ( ! ISSET($loc) ) { $loc=0; $next=1; }
elseif( $next == 1 ) {$loc +=50;}
else ($loc -= 50;}
If ($loc < 0 ) {$loc = 0;}
with links like this(<A
href=\"browse.php?loc=$loc&next=0\">Previous</A>";
A
href=\"browse.php?loc=$loc&next=1\">Next</A>";)
How could I combine these operations?
Thanks in advance for the help,
Mike