RE: putting the results of a query inro an array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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 form....spell it out

while($row = mysql_fetch_array($result){
	$arrayName[] = $row['name'];
	$arrayEMail[] = $row['email'];
}
print_r($arrayName);
print_r($arrayEMail);

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux