How do i select the next record in a database? The values in the record_id field are not consecutive numbers (since some records have been deleted).
help would be much appreciated. thanks.
a call to mysql_fetch_array (or eqivalent by what database you are using) grabs the next result if there is one.
$result = mysql_query(sql statement); while($row = mysql_fetch_array($result)) { //this will go through the records one by one
}
Ace21
Ace, thanks for the response. I want to create a link on the page that goes to the next record in the database. what would the querystring be?
i could be way off track. thanks again.
Have you read the article about prev and next buttons?
i'm new to all of this and i don't need all of the other stuff from the article. i need only 2 links (prev and next).
please help
then what you need to do is keep track of what record you are looking at. After that read up on LIMIT on www.mysql.com. this will allow you to limit what record you want to pull.
LIMIT should get you what you want.
What you need is to understand the principle behind it, and that is explained in the article.
Did you read it?