Re: next & previous record

From: Date: Thu, 22 Feb 2001 18:03:17 +0000
Subject: Re: next & previous record
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-6878@lists.php.net to get a copy of this message
I don't know about "Cursors" but I think you can use the same approach we discussed on navigate record by record, " retrieval of NEXT, PREV records" was the subject. If set an order by clause and search for the first record you can use a where clause like this : ... $current = $row["field"] ; // for next row $query = "select * from table where field_name > '$current' limit 1"; // for previous row $query = "select * from table where field_name < '$current' limit 1"; HTH Jayme. www.conex.com.br/jjeffman/antispam.html -----Mensagem Original----- De: Andrew Hill <ahill@openlinksw.com> Para: Dreamvale <dreamvale@dreamvale.com>; <php-db@lists.php.net> Enviada em: quinta-feira, 22 de fevereiro de 2001 14:10 Assunto: RE: [PHP-DB] next & previous record > You want to use Cursors, and I don't believe MySQL supports cursors yet, > although I could be wrong. > > Best regards, > Andrew > -------------------------------------- > Andrew Hill - OpenLink Software > Director Technology Evangelism > eBusiness Infrastructure Technology > http://www.openlinksw.com > > > > -----Original Message----- > > From: Dreamvale [mailto:dreamvale@dreamvale.com] > > Sent: Thursday, February 22, 2001 11:42 AM > > To: php-db@lists.php.net > > Subject: Re: [PHP-DB] next & previous record > > > > > > I was not refering pagination. > > > > suppossing there are these 3 records > > > > ABC > > DEF > > GHI > > LJK > > > > now a search is done by entering D, which using like & %, and limit would > > return the record DEF. The "next" would forward to GHI and > > "previous" would > > backward to ABC. > > > > any idea? > > > > thanks. > > > > > > ----- Original Message ----- > > From: "Brunner, Daniel" <daniel.brunner@duni.com> > > To: <php-db@lists.php.net> > > Sent: Friday, February 23, 2001 12:12 AM > > Subject: FW: [PHP-DB] next & previous record > > > > > > > > Check this link out... > > > > http://www.oreillynet.com/pub/a/php/2000/11/02/next_previous.html?page > > > > =1 > > > > > > > > It's about Next/previous links... > > > > > > > > It does work, but I've yet to get to get it to work completely with > > > > displaying the records (rows) and the links at the same time... > > > > > > > > It just takes some time to find how to use the mysql_query variable to > > > > print out the rows, with every click of the link...... > > > > > > > > If you get any head way let me know... > > > > > > > > It's great code.... > > > > > > > > Dan > > > > > > > > > > > > > > > > ---------- > > > > From: Dreamvale > > > > Sent: Thursday, February 22, 2001 9:55 AM > > > > To: php-db@lists.php.net > > > > Subject: [PHP-DB] next & previous record > > > > > > > > hi all, > > > > > > > > need to implement record scrolling, one at a time -either forward or > > > > backward, on MySQL. The key is a char (32) containing part numbers. > > > > > > > > anyone has done this before? > > > > > > > > thanks in advance. > > > > > > > > dreamvale > > > > > > > > > > > > -- > > > > 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 > > > > > > > > > > > > > > > > > > -- > > > 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 > > > > > > > > > -- > > 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 > > > > > > > -- > 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 >

« previous php.db (#6878) next »