Re: Next and Preview Row
| From: | Raymond Gubala | Date: | Fri, 22 Feb 2002 15:37:23 +0000 |
| Subject: | Re: Next and Preview Row | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85854@lists.php.net to get a copy of this message | ||
The solution I have been using is to do three queries similar to the below
SELECT * FROM table WHERE field='ID00025'
SELECT * FROM table WHERE field<'ID00025' ORDER BY field DESC LIMIT 0,1
SELECT * FROM table WHERE field>'ID00025' ORDER BY field ASC LIMIT 0,1
If you whish more row returned change the number in the LIMIT
--
Raymond Gubala
Program Coordinator
Multimedia Design and Web Developer
Durham College
mailto:gubala@dca.durhamc.on.ca
> From: "Mark Lo" <markloky@netvigator.com>
> Date: Fri, 22 Feb 2002 23:15:18 +0800
> To: <mysql@lists.mysql.com>, <php-general@lists.php.net>
> Cc: <markloky@netvigator.com>
> Subject: [PHP] Next and Preview Row
>
> Dear All,
>
> I am using PHP + MYSQL. I have a question that I need some expert
> to help. That is:
>
> How do I find out a next and preview row values by using PHP and MYSQL. For
> examples,
>
> Row 10 ID00010 need this value
> Row 11 ID00025 have this value on hand
> Row 12 ID00063 need this value
>
> The questions is how do I find out the values in Row 10 and Row 12, if and
> only if I only have one data that is "ID00025" (select * from table where
> field="ID00025") . But, the questions is How do I find out the data in Row
> 10 and Row 12 which is "ID00010" and "ID00063" assume I don't know the
> values of "ID00025" is in Row 11.
>
> Thank you so much for your help.
>
>
> Mark Lo
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php