What is the easiest way to turn a mysql result variable into a multidimensional array in php?
Thanks
What is the easiest way to turn a mysql result variable into a multidimensional array in php?
Thanks
Run mysql_fetch_assoc in a loop.
while ($row = mysql_fetch_assoc($result)) {
$table[] = $row;
}
print_r($table);
if you happen to be using the mysqli extension and php 5.3, you could use http://us2.php.net/manual/en/mysqli-result.fetch-all.php