Re: [PHP] convert query result to array

[email protected] (Stut)
Newsgroups php.general
Message-ID <[email protected]>
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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.