Jump to content

next and prev buttons


angryjohnny

Recommended Posts

Hello,

Right now I have a very simple page that displays 1 row from a table that holds about 200 rows. I have a next button that cycles through them.

 

$prev = $id - 1;

$next = $id + 1;

<a href='template.php?id=$prev'>prev</a>

<a href='template.php?id=$next'>next</a>

 

As you can see its very simple.

 

My problem, lets say I have a search function or a 'template02.php' page that only selects rows from the table that holds the name 'john' from the $name colum, which in this case holds 6 items that have the id numbers: 7, 9, 22, 44, 76 and 89. I want to make a 'next' and 'previous' link, that links to the respective item.

 

Any Ideas?

 

John

 

Link to comment
https://forums.phpfreaks.com/topic/113223-next-and-prev-buttons/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.