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

Posted by Jim Whitaker on 10/11/78 11:45

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?
Example in english of what I am asking:
Say the result set is as follows:
ID FROMCITY
23 CLEVELAND
24 DETROIT

I want to goto record with ID of 23 first, and store CLEVELAND in a tempvar,
so temppvar = FROMCITY.
Now, I want to move to ID 24 and store DETROIT like this:
tempvar = tempvar + " / " + FROMCITY
At this point tempvar would be CLEVELAND / DETROIT.
This is what I'm after, loop through a recordset. I mean in the background
in code, not manually do this.
You can't tell me you can't loop through a recordset using php.

> $result = mysql_query(some_query);
> while(mysql_fetch_array($result,MYSQL_ASSOC){
> //do stuff with it
> }
>
>

 

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

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