I WanT To Code PHP Posted May 12, 2009 Share Posted May 12, 2009 Why am i getting this error and how can i fix it please help..!! Here are lines 702 and on.... $oldreports=mysql_query("SELECT matchid,challenger,challenged FROM matches WHERE status='Waiting for Scores'"); while(list($matchid,$challenger,$challenged)=mysql_fetch_row($oldreports)){ $getreport=mysql_query("SELECT * FROM match_reports WHERE reporter='$challenger' AND matchid='$matchid'"); $getreport=mysql_fetch_array($getreport); $getreport2=mysql_query("SELECT * FROM match_reports WHERE reporter='$challenged' AND matchid='$matchid'"); $getreport2=mysql_fetch_array($getreport2); Quote Link to comment https://forums.phpfreaks.com/topic/157859-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/ Share on other sites More sharing options...
Maq Posted May 12, 2009 Share Posted May 12, 2009 Put this at the end of your query: $oldreports=mysql_query("SELECT matchid,challenger,challenged FROM matches WHERE status='Waiting for Scores'") or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/157859-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/#findComment-832631 Share on other sites More sharing options...
I WanT To Code PHP Posted May 12, 2009 Author Share Posted May 12, 2009 OK thanks for quick reply, now i get his error on the homepage.. Unknown column 'challenger' in 'field list' Quote Link to comment https://forums.phpfreaks.com/topic/157859-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/#findComment-832636 Share on other sites More sharing options...
Maq Posted May 12, 2009 Share Posted May 12, 2009 OK thanks for quick reply, now i get his error on the homepage.. Unknown column 'challenger' in 'field list' are you sure that column exists in your table? Quote Link to comment https://forums.phpfreaks.com/topic/157859-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/#findComment-832640 Share on other sites More sharing options...
I WanT To Code PHP Posted May 12, 2009 Author Share Posted May 12, 2009 I was missing challenged in my table... can anyone tell fropm this code what lines i need in the table challanged.... Like for example challangerid varchar 225 $oldreports=mysql_query("SELECT matchid,challenger,challenged FROM matches WHERE status='Waiting for Scores'"); while(list($matchid,$challenger,$challenged)=mysql_fetch_row($oldreports)){ $getreport=mysql_query("SELECT * FROM match_reports WHERE reporter='$challenger' AND matchid='$matchid'"); $getreport=mysql_fetch_array($getreport); $getreport2=mysql_query("SELECT * FROM match_reports WHERE reporter='$challenged' AND matchid='$matchid'"); $getreport2=mysql_fetch_array($getreport2); if($getreport[reportid] AND !$getreport2[reportid]){ $_updated = strtotime($getreport[reported]); $time = time(); $diff = $time - $_updated; $diff = $diff - '60'; if ($diff > 14400){ $getwinner=mysql_query("SELECT * FROM team WHERE teamid='$challenger'"); $getwinner=mysql_fetch_array($getwinner); $getloser=mysql_query("SELECT * FROM team WHERE teamid='$challenged'"); $getloser=mysql_fetch_array($getloser); Quote Link to comment https://forums.phpfreaks.com/topic/157859-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/#findComment-832683 Share on other sites More sharing options...
Ken2k7 Posted May 12, 2009 Share Posted May 12, 2009 ??? What? Quote Link to comment https://forums.phpfreaks.com/topic/157859-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/#findComment-832692 Share on other sites More sharing options...
Maq Posted May 12, 2009 Share Posted May 12, 2009 I don't know what you're trying to say here... I don't see where you're trying to select from the table 'challenger'. Do you mean that the field 'challenger' doesn't exist and you want to change it to 'challengerid'? Quote Link to comment https://forums.phpfreaks.com/topic/157859-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/#findComment-832695 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.