Re: how to extract fields from associative array into different variables
| From: | Eddie Drapkin | Date: | Mon, 15 Jun 2009 20:24:13 +0000 |
| Subject: | Re: how to extract fields from associative array into different variables | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-294051@lists.php.net to get a copy of this message | ||
You could use list() a la
list($foo, $bar) = mysql_fetch_row();
On Mon, Jun 15, 2009 at 4:19 PM, PJ <af.gourmet@videotron.ca> 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@ptahhotep.com
> 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
>
>