lengman Posted November 13, 2008 Share Posted November 13, 2008 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/igweeccr/public_html/includes/functions.php on line 239 The line is: while($tard_bar=mysql_fetch_object($drop_bar)){ The code is: $drop =mysql_query("SELECT * FROM casinos"); while($tard=mysql_fetch_object($drop)){ $per = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$tard->owner'")); if ($per->status == "Dead" || $per->status == "Banned"){ mysql_query("UPDATE casinos SET owner='0' WHERE casino='$tard->casino' AND owner='$tard->owner'"); } } $drop_bar =mysql_query("SELECT * FROM bar"); while($tard_bar=mysql_fetch_object($drop_bar)){ $per_bar = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$tard_bar->owner'")); if ($per_bar->status == "Dead" || $per_bar->status == "Banned"){ mysql_query("UPDATE bar SET owner='0' WHERE owner='$tard_bar->owner'"); } } $drop_crew =mysql_query("SELECT * FROM crews"); while($tard_crew=mysql_fetch_object($drop_crew)){ $per_crew = mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$tard_crew->owner'")); if ($per_bar->status == "Dead" || $per_bar->status == "Banned"){ mysql_query("UPDATE crew SET owner='$tard_bar->rhm', rhm='' WHERE owner='$tard_bar->owner'"); } Can anyone see a problem with this? I'm pretty new to php and mysql, but I can't find the problem with it. Any help would be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/132548-warning-mysql_fetch_object-supplied-argument-is-not-a-valid-mysql-result-res/ Share on other sites More sharing options...
Mchl Posted November 13, 2008 Share Posted November 13, 2008 Use $drop_bar =mysql_query("SELECT * FROM bar") or die(mysql_error()); to display any errors your queries might cause (attach or die(mysql_error()); to all queries) Link to comment https://forums.phpfreaks.com/topic/132548-warning-mysql_fetch_object-supplied-argument-is-not-a-valid-mysql-result-res/#findComment-689244 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.