Re: [PHP] convert query result to array

2008-05-14 Thread Philip Thompson
On May 13, 2008, at 6:35 AM, Sanjeev N wrote: fetchAll() works if php version is greater than 5. As Wang suggested, we should write our own function. its easy... i have done so many times for larger database. Store earch rows of the resultset in the array (multidimensional ie. 2). and then

Re: [PHP] convert query result to array

2008-05-13 Thread Sanjeev N
fetchAll() works if php version is greater than 5. As Wang suggested, we should write our own function. its easy... i have done so many times for larger database. Store earch rows of the resultset in the array (multidimensional ie. 2). and then work on the array using the loops & conditions $qu

Re: [PHP] convert query result to array

2008-05-12 Thread Forcey
I guess PDOStatement::fetchAll() should work? see http://www.php.net/manual/en/pdostatement.fetchall.php for details. - Forcey On Tue, May 13, 2008 at 9:55 AM, Yi Wang <[EMAIL PROTECTED]> wrote: > I think flance's meaning is whether there is a build-in function that > can convert the result set

Re: [PHP] convert query result to array

2008-05-12 Thread Yi Wang
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 <[EMAIL PROTECTED]> wrote: > On 12 May 2008, at 15:56, It flance wrote: > > > is there any function that can convert the result of q

Re: [PHP] convert query result to array

2008-05-12 Thread Stut
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 ar

[PHP] convert query result to array

2008-05-12 Thread It flance
Hi, 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