You are here: Re: looping in php « PHP Programming Language « IT news, forums, messages
Re: looping in php

Posted by Jim Whitaker on 04/22/06 07:00

Thanks for all replies, I finally figured out looping in php.
"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:e27hua$i4k$1@netlx020.civ.utwente.nl...
> william.clarke@gmail.com wrote:
> >>> $result = mysql_query(some_query);
> >>> while(mysql_fetch_array($result,MYSQL_ASSOC){
> >>> //do stuff with it
> >>> }
> >> In the below, say I did whatever I wanted to do to with this record,
ie.,
> >> retrived a city to a temp variable. How do I move or goto the next
> record?
>
> That's what you do with mysql_fetch_array().
>
> > As milahu and Rik said this is PHP looping through a result
> > set...(maybe not in the VB sense). There isn't a direct equivalent to
> > the VB6 recordset, but you don't need one.
>
>
> Don't know much about VB, but if you want to handle it as a complete
> recordset: instead of processing the rows one by one:
>
> $myrecordset = array();
> while($row = mysql_fetch_array($result,MYSQL_ASSOC){
>
> $myrecordset[] = $row;
> }
>
> Et voil�, a multidimensional array to abuse as you which.
>
> Grtz,
> --
> Rik Wasmus
>
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация