* Thus wrote jwulff ([EMAIL PROTECTED]):
> 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)
> );

Do you mean:
$example_data = array (
  1 => array(25,8),
  2 => array(10,8)
)

So thus you can access the data like


$example_data[1]; //access type 1 records.
$example_data[2]; //access type 2 records.

Now of course what and how you store the items in there is another
thing, is it just an array of one value? or an array of array's?

if its the first then you can just do something like

select type, number_field from numbers

for each row in the database:
  $example_data[$row['type']][] = $row['number_field'];


HTH,

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to