Re: how to extract fields from associative array into different variables

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

 



You could use list() a la
list($foo, $bar) = mysql_fetch_row();

On Mon, Jun 15, 2009 at 4:19 PM, PJ <af.gourmet@xxxxxxxxxxxx> wrote:

> Jay Blanchard wrote:
> > [snip]
> > Is there an easier or simpler way to do this?
> > [/snip]
> >
> > http://us2.php.net/manual/en/function.mysql-fetch-row.php
> >
> In what way would this simplify or ease my pain?
> The difficulty, it seems to me, is not in retrieving the rows, but
> rather how to pass the row data to the variables. And since the number
> of rows is variable, I believe that the only way to assign the variables
> is by use of a loop? I think I'm beating my head against the wall for
> nothing... :-(
> I know I'm a newbie (a very lazy and ignorant one, apparently) but I
> don't quite understand. Or is there a gain in execution time or resource
> usage?
>
>
> --
> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
> -------------------------------------------------------------
> Phil Jourdan --- pj@xxxxxxxxxxxxx
>   http://www.ptahhotep.com
>    http://www.chiccantine.com/andypantry.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[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