flashwebhost
05-17-2007, 08:49 AM
Hi,
I need to get MySQL query result into array.
mysql_fetch_array can do it, but only for a row. I need entire results into an array.
$myarray = mysql_fetch_array($result);
If i print, i get some thing like below
Array
(
[0] => 1
[id] => 1
[1] => Sports
[name] => Sports
)
This is only for one record, i need to get multiple records in to same array, so i can pass it to smarty template system, that can display the array.
Any suggestions ?
With adodb, there is a function
$myarray = $rs->getarray();
I need exactly same done with mysql basic functions (no adodb).
Thanks,
Yujin
I need to get MySQL query result into array.
mysql_fetch_array can do it, but only for a row. I need entire results into an array.
$myarray = mysql_fetch_array($result);
If i print, i get some thing like below
Array
(
[0] => 1
[id] => 1
[1] => Sports
[name] => Sports
)
This is only for one record, i need to get multiple records in to same array, so i can pass it to smarty template system, that can display the array.
Any suggestions ?
With adodb, there is a function
$myarray = $rs->getarray();
I need exactly same done with mysql basic functions (no adodb).
Thanks,
Yujin
