Re: multiple pages for large result sets
| From: | Jason Wong | Date: | Wed, 30 Jan 2002 03:32:27 +0000 |
| Subject: | Re: multiple pages for large result sets | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16294@lists.php.net to get a copy of this message | ||
On Wednesday 30 January 2002 09:48, mike@wkla.com wrote:
> 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?
Have you tried:
<a href="browse.php?loc=$loc&next=1&cat=food">Next</a>
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
A kiss is a course of procedure, cunningly devised, for the mutual
stoppage of speech at a moment when words are superfluous.
*/