assuming you are "currently" looking at a page which is something like
php.php?record=3, then you should be able to just do
<a href='php.php?record=<?php echo ($record-1) ?>'>Previous record</a><a
href='php.php<?php echo ($record+1) ?>'>Next record</a>
and then on the php.php page, you would obviously being grabbing something
from the database using a unique identifier or similar.
one "gotcha" to be careful of - if there is a chance that your id field will
have a gap in it (ie. not be perfectly consecutive) then you should make
your query something like
SELECT * FROM table LIMIT $record, 1
SELECT * FROM table WHERE id='$record'
Since that takes them in whatever order, but only SELECTs from $record and
gets 1 record.
// -----Original Message-----
// From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 13 May 2002 1:14 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Link for next db record
// Hi all,
// Wondering if you could help or point me to a tut where I
// can use a link to
// get the next record in the db?
// Like <a href='php.php'>Previous record</a><a
// href='php.php'>Next record</a>
// How do I go about doing this.
// The sleeper has awaken
// Outgoing mail is certified Virus Free.
// Checked by AVG anti-virus system (http://www.grisoft.com).
// Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php