Re: retrieval of NEXT, PREV records
| From: | Peter J. Krawetzky | Date: | Tue, 20 Feb 2001 15:45:29 +0000 |
| Subject: | Re: retrieval of NEXT, PREV records | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-6783@lists.php.net to get a copy of this message | ||
Check for a return code from the (I assume you are using a relational
database) database stating a row was not found. If the condition is true,
then re-execute the ID+1 or ID-1 code to select the next row in sequence.
You can keep looping through this until you get a return code from the
database that states a row was found.
Peter
-----Original Message-----
From: Adv. Systems Design <asd_2000@yahoo.com>
To: php-db@lists.php.net <php-db@lists.php.net>
Date: Tuesday, February 20, 2001 9:41 AM
Subject: [PHP-DB] retrieval of NEXT, PREV records
>I have set up links to browse records one by one,
>using (ID+1) for NEXT and (ID-1) for PREV...the only
>problem is that if there is a hole in the ID sequence
>(as from DELETION), there is no record returned...How
>can I have it so that the 'holes' are paved over and
>not returned?
>
>TIA
>
>Luis
>
>__________________________________________________
>Do You Yahoo!?
>Get personalized email addresses from Yahoo! Mail - only $35
>a year! http://personal.mail.yahoo.com/
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
>For additional commands, e-mail: php-db-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>