I have no idea why my coding is behaving this way. For some reason, this keeps screwing up.
The code successfully echos the number 4, which is the number of rows in the result. However, when I try to run a mysql_fetch_array on it, it doesn't even cycle through. This code should theoretically email me 4 times, but it doesn't. No matter what I do, I can't get it to execute the code inside the while loop. All I receive from the code below is one email with the number 0 in it (which I assume to be from the final call of the mail() funtion, outside of the while loop. Does anyone have any ideas?
$c = 0;
echo mysql_num_rows($result);
while ($rows = mysql_fetch_array($result)) {
mail("aaron_karp@yahoo.com", "count", $c);
$c++;
}
mail("aaron_karp@yahoo.com", "count", $c);
Thanks!