Re: convert query result to array
| From: | Yi Wang | Date: | Tue, 13 May 2008 01:55:26 +0000 |
| Subject: | Re: convert query result to array | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274209@lists.php.net to get a copy of this message | ||
I think flance's meaning is whether there is a build-in function that
can convert the result set to an array.
The short answer is: do it yourself.
On 5/12/08, Stut <stuttle@gmail.com> wrote:
> On 12 May 2008, at 15:56, It flance wrote:
>
> > is there any function that can convert the result of query to an
> associative array?
> >
> > what i want is the following:
> >
> > $query = "select * from tablename";
> > $result = mysql_query($query);
> > $arr = somefunction($result);
> >
> > where $arr should be an assoiative array whose indices have the same name
> as the fields names of table tablename.
> >
>
> http://php.net/mysql_fetch_assoc
>
> Please please please read the manual: http://php.net/mysql
>
> -Stut
>
> --
> http://stut.net/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Regards,
Wang Yi