My dump: # phpMyAdmin MySQL-Dump # http://phpwizard.net/phpMyAdmin/ # # Host: 192.168.1.11:3306 Database : test # --------------------------------------------------------
# # Table structure for table 'some' # CREATE TABLE some ( id varchar(6) NOT NULL, descr varchar(250) NOT NULL ); # # Dumping data for table 'some' # INSERT INTO some VALUES ( 'ID0001', 'first line'); INSERT INTO some VALUES ( 'ID0002', 'Second line'); INSERT INTO some VALUES ( 'ID0010', 'Third row'); INSERT INTO some VALUES ( 'ID0015', 'Fourth row'); INSERT INTO some VALUES ( 'ID0023', 'Fifth row'); INSERT INTO some VALUES ( 'ID0026', 'Sixth row'); Try this sql on this table: select * from some where id<'ID0015' order by id desc limit 0,1; select * from some where id>'ID0015' order by id limit 0,1; Best regards, Andrey Hristov ----- Original Message ----- From: "Mark Lo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, February 22, 2002 5:15 PM 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 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php