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:[EMAIL PROTECTED]]
> Sent: Wednesday, July 11, 2001 2:53 PM
> To: [EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to