Re: HELP - Clean and simple

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/22/06, Jonas Rosling <webmaster@xxxxxxxxxxxx> wrote:

while($row=mysql_fetch_array($result)) {

        if (!$$row[0]) {

                $$row[0] = array();

                $$row[0][$row[2]] = $row[1];

        }

        else {

                $$row[0][$row[2]] = $row[1];

        }

}


IMO, unless you have a *really* good reason for doing things this way,
putting values into an array is almost always better than using the "$$"
direct declaration.

i.e.  why not use? $vars[ $row[0] ][ $row[2] ] = $row[1];

--
Scott Hurring [scott dot hurring dot lists at gmail dot com]
http://hurring.com/

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux