how can i pass mysql_fetch_array() to array()
A:
did you mean:
$variable = mysql_fetch_array($result); //$variable is now an array
erenon
2009-12-25 09:07:17
A:
mysql_fetch_array() is just a function that outputs an array, so you can simply attach it to any variable, like so:
$foo = mysql_fetch_array($bar);
Chad
2009-12-25 10:04:05
+1
A:
If you want to use it for multiple results you may want to assign within the while statement. Such as
$query = mysql_query("SELECT * FROM users");
$resultSet = array();
while($result = mysql_fetch_array($query))
{
$resultSet[] = $result;
}
marvin
2009-12-25 11:42:01