Next, prev, records in MySql. Handler Function
| From: | Alvaro Cobo | Date: | Thu, 09 Feb 2006 01:10:08 +0000 |
| Subject: | Next, prev, records in MySql. Handler Function | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-41195@lists.php.net to get a copy of this message | ||
Dear all:
I have been exploring about this issue quite a lot, and find no solution:
Platform: Debian, MySql 4.1.11, PHP 4.3.10-2, Apache.
Is there any way I can retrieve a set of values depending in a where clause:
For example:
from a set of values in one field: 1,2,5,8,9,11,13
I'd like to retrieve a record (8) and also the previous one (5) and the
next one (9) (so the record set would be: 5,8,9)
I have found the "Handler" function in the Manual, but it and keeps
giving me errors (I have also checked in the manual and it seems to work
with MySql 4.1.x)
/* --Start example
---------------------
HANDLER tbl_sm04_indicador READ PK_indicador_id { FIRST | NEXT | PREV |
LAST }
WHERE PK_indicador_id=8
LIMIT 0, 3
----------------------
--End example (I know, I am completely lost)*/
Does anybody has tried this function before?.
Is it useful for the result I would like to accomplish?
Could anybody could share an example of how to use this function?
Thanks and best regards.
Alvaro Cobo