Forum Moderators: coopster

Message Too Old, No Replies

Fetching next-previous record from mysql result

Is there any function in php/mysql for this?

         

kunwarbs

11:48 am on Jul 14, 2007 (gmt 0)

10+ Year Member



while fetching he results from MYSQL, how can i move between the result records.

eg. the mysql query fetches 10 matching records. User clicks on record #5 to see record details. Now I want to provide the user with an option to move on to record #4(previous record) or record #6 (next record) without taking user back into the query result page and then make him click on record #4 or #6

please advise..

coopster

12:20 pm on Jul 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You could always pass the "before" and "after" keys for those two records to your details display page that you are on via hidden fields, part of the query string or perhaps through session variables. Otherwise you will have to build those two record options by reading the database again on your display page.

phranque

7:07 pm on Jul 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



or you could code the current index or before/after indices with before/after parameters in the before/after links