Reply to Re: variable variables question

Your name:

Reply:


Posted by d on 10/14/04 11:39

"Dave" <gweedoh@hotmail.com> wrote in message
news:1139531157.994561.231000@g14g2000cwa.googlegroups.com...
> I'm a bit unclear on the variable variables section of the PHP manual.
> Here's what I want to accomplish:
>
> $01_varA="foo"
> $02_varA="bar"
> $03_varB="boo"
> $04_varB="far"
>
> "01" through "04" are being gathered via mysql query as "id" in the
> example.
>
>
> I want to do this.....
>
> $sql_query=("SELECT * from database");
>
> while ($sql_array=($sql_query)){
> echo $sql_array["id"] . "_varA";
> echo $sql_array["id"] . "_varB";
> }
>
> ...so that it will echo the values of $01_varA, $02_varA, $03_varB and
> $04_varB in no particular order.
>

Any reason you're not using arrays? :)

[Back to original 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

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