Re: Looping through

From: Date: Tue, 07 Nov 2000 10:57:26 +0000
Subject: Re: Looping through
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-4275@lists.php.net to get a copy of this message
Another question is : how to deal with "limit" ? If I have many records that match the query but I'm using limit for performance optimization, how can I get the next five records that match the query and so on ? How can I put this in a "while" style structure like "spiders" do when searching pages ? Jayme. http://www.conex.com.br/jjeffman -----Mensagem Original----- De: <joe@jwebmedia.com> Para: bryan <bryan@concept-factory.com> Cc: <php-db@lists.php.net> Enviada em: segunda-feira, 6 de novembro de 2000 20:48 Assunto: Re: [PHP-DB] Looping through > Just at first glance it seems that your "Where id = 1" clause is gonna > prevent you from getting more than one record at a time, assuming id is > a unique field. Anyway, when you want to loop through, do something > like: > > $data_list = mysql_db_query(database, sql); > > <?while ($data = mysql_fetch_array($data_list):?> > Put your HTML in here that you want to loop through for each record. > Calling the data like $data["fieldname"] > <?endwhile;?> > > Hope this helps, > > Joe > > > -- > 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 (#4275) next »