RE: [PHP] finding next and prev record in mysql
| From: | Richard Kurth | Date: | Fri, 11 May 2007 06:39:56 +0000 |
| Subject: | RE: [PHP] finding next and prev record in mysql | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254786@lists.php.net to get a copy of this message | ||
-----Original Message-----
From: Chris [mailto:dmagick@gmail.com]
Sent: Thursday, May 10, 2007 10:09 PM
To: Richard Kurth
Cc: php-general@lists.php.net
Subject: Re: [PHP] finding next and prev record in mysql
Richard Kurth wrote:
> How would I find the next id and the prev id in sql statement like the
> one below. The id number is not going to be in order so I can't do a <
> or > limit 1 on the search
>
> SELECT id FROM contacts WHERE category = '5' AND subcategory = '1' AND
> members_id= '8' ORDER BY lastname
Ask the mysql list: http://lists.mysql.com/
I'm sure they have been asked a similar thing many times in the past.
I did but have not received any reply at all