I have run into this problem multiple times, and I cannot figure out why it happens. When I build a MySQL statement like the following it works just fine:
$sql=mysql_query("SELECT * FROM table WHERE id='$something'");
while($row=mysql_fetch_array($sql)){
$someVar=$row['whatever'];
//and so on
}
But when I combine the first two statements to the following:
while($row=mysql_fetch_array(mysql_query("SELECT * FROM table WHERE id='$something'")))
and try to loop through them, the page seems to loop infinitely without loading or returning an error. Why doesn't the second statement work?