Niccaman Posted March 18, 2009 Share Posted March 18, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/150037-solved-help-with-while-row-mysql_fetch_arrayres/ Share on other sites More sharing options...
Niccaman Posted March 18, 2009 Author Share Posted March 18, 2009 bump plz help! Quote Link to comment https://forums.phpfreaks.com/topic/150037-solved-help-with-while-row-mysql_fetch_arrayres/#findComment-787978 Share on other sites More sharing options...
trq Posted March 18, 2009 Share Posted March 18, 2009 Your kidding aren't you? Its been ten minutes. I suggest you read our rules. Quote Link to comment https://forums.phpfreaks.com/topic/150037-solved-help-with-while-row-mysql_fetch_arrayres/#findComment-787980 Share on other sites More sharing options...
PFMaBiSmAd Posted March 18, 2009 Share Posted March 18, 2009 And add the following two lines immediately after your first opening <?php tag - ini_set ("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/150037-solved-help-with-while-row-mysql_fetch_arrayres/#findComment-787982 Share on other sites More sharing options...
Zane Posted March 18, 2009 Share Posted March 18, 2009 while ($row = mysql_fetch_array($res)) ; Quote Link to comment https://forums.phpfreaks.com/topic/150037-solved-help-with-while-row-mysql_fetch_arrayres/#findComment-787984 Share on other sites More sharing options...
Niccaman Posted March 18, 2009 Author Share Posted March 18, 2009 Im sorry admin, I'm just really anxious to overcome what seems to be the most unnecessary error. Its halting my progress with my site. It seemed a lot longer than 10 mins Anyway, That error provided an empty page... ??? ??? Quote Link to comment https://forums.phpfreaks.com/topic/150037-solved-help-with-while-row-mysql_fetch_arrayres/#findComment-787987 Share on other sites More sharing options...
Niccaman Posted March 18, 2009 Author Share Posted March 18, 2009 AHHH the semi-colon!! haha ty so much.!! Quote Link to comment https://forums.phpfreaks.com/topic/150037-solved-help-with-while-row-mysql_fetch_arrayres/#findComment-787989 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.