RE: [PHP] Back/Forward

From: Date: Wed, 11 Jul 2001 19:58:49 +0000
Subject: RE: [PHP] Back/Forward
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-57477@lists.php.net to get a copy of this message
Since IDs can disappear when records are delted, I think it's best to do a COUNT() first, then retrieve your listings with SELECT * FROM table WHERE blah LIMIT offset,number_to_retrieve; -----Original Message----- From: scott [gts] [mailto:scott@graphictype.com] Sent: Wednesday, July 11, 2001 2:55 PM To: php Subject: RE: [PHP] Back/Forward how do you have the data stored? by ID number? if you have it stored by ID number, just put next/back links something like this: <? // here, find out the max number of rocks $prev = (($id>0)? $id-1 : 0 ); $next = (($id<$max)? $id+1 : $max ); ?> <A HREF="rock.php?id=<?= $prev ?>">previous</A> <A HREF="rock.php?id=<?= $next ?>">next</A> > -----Original Message----- > From: Devin Atencio [mailto:dreamboy@aros.net] > Sent: Wednesday, July 11, 2001 2:53 PM > To: php-general@lists.php.net > Subject: [PHP] Back/Forward > > > > I have a page that brings up the info on a rock, I wanted to add the > functionality of doing like a <next> and <previous> option to go thru > all the rocks in my database. I can't figure out how to exactly do > this, could someone give me some help? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#57477) next »