Converting a MySQL result into a complex array
| From: | jwulff | Date: | Mon, 21 Jul 2003 23:38:55 +0000 |
| Subject: | Converting a MySQL result into a complex array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-156162@lists.php.net to get a copy of this message | ||
How would I take the results of the following MySQL statement and put it
into an array as follows?
SELECT * FROM numbers WHERE type=
1;
SELECT * FROM numbers WHERE type=2;
$example_data = array(
array("1",25,8),
array("2",10,8)
);
All the results of type=1 would be in the first nested array and all the
results of type=2 would be in the second and so on.