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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.