[PHP] putting the results of a query inro an array

2005-04-18 Thread Ross
how can I put the results from the following query into two arrays? The only fields are 'name' and 'email' $query = SELECT * FROM contacts; $result= mysql_query($query); $number= mysql_num_rows ($result); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] putting the results of a query inro an array

2005-04-18 Thread Jay Blanchard
[snip] The only fields are 'name' and 'email' $query = SELECT * FROM contacts; $result= mysql_query($query); $number= mysql_num_rows ($result); [/snip] Using * in a query like this is bad formspell it out while($row = mysql_fetch_array($result){ $arrayName[] = $row['name'];