Jump to content

[SOLVED] Help with "While ($row = mysql_fetch_array($res))"


Niccaman

Recommended Posts

I have tested the following code with echo's, and what i have found is the while loop is never executed.

 

$res = mysql_query("SELECT * FROM personal") or die(mysql_error());

while ($row = mysql_fetch_array($res));

{

$num = $row['wealth'];

$wealth = $wealth + $num;

echo $num;

}

 

Even though i have many rows contained within a column named wealth inside a table named personal and all the values are integers, it never executes the while loop. Why?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.