You are here: Re: converting array $row values to $string « PHP Programming Language « IT news, forums, messages
Re: converting array $row values to $string

Posted by monomaniac21 on 10/30/02 11:53

What i cant see is how the function finds out the name given to each
row of the array?

Can anyone explain this to me?

monomaniac21 wrote:

> Cheers Nyoka I'm sure it does work.
>
> but i dont understand it. what is the double $$ for and "global"?
>
> :-)
>
>
> Nyoka wrote:
> > You could write your own function similar to:
> > function convertArray ($array) {
> > foreach ($array AS $name => $value) {
> > global $$name;
> > $$name = $value;
> > }
> > }
> >
> > Make sure you do a print_r ($array) before using this so you are away
> > of what variables are going to be used.
> >
> > monomaniac21 wrote:
> > > hi all
> > >
> > > is there a function to convert all values of array $row into seperate
> > > variables:
> > >
> > > $row = mysql_fetch_array($result);
> > >
> > > // i dont want to have to do this anymore :-)
> > >
> > > $name = $row['name'];
> > > $address1 = $row['address1'];
> > > $address2 = $row['address2'];
> > > etc etc etc
> > >
> > >
> > >
> > >
> > > Regards
> > >
> > > marc

 

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

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