Possible Duplicate:
Looping through mysql_fetch_array in PHP
I have a simple join query that should echo out each array result in a foreach loop. The array is not empty. Printing the array count works -- there are 801 results. However, actually printing out the rows either above or within the foreach only prints the first result. Any help would be appreciated.
$listQuery = "SELECT r.email_address
FROM wholesale_accounts a
LEFT JOIN wholesale_register r ON r.register_id = a.register_id
WHERE r.email_address != ''
ORDER BY r.email_address";
$listResult = mysql_query($listQuery);
//print_r($listResult); // prints (Resource ID #21)
//exit;
$rows = mysql_fetch_array($listResult, MYSQL_ASSOC);
$count = mysql_num_rows($listResult);
//print_r($count); // prints 801
print_r($rows); // only prints first email address
exit;
foreach($rows as $row) {
print_r($row); // prints email address
}