justoneguy Posted June 1, 2007 Share Posted June 1, 2007 please help this error comes up i have no idea ??? Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /right.php on line 105 <? if ($crew =="1") { $bb = mysql_query("SELECT * FROM replys WHERE idto='$viewtopic' forum='$forum' AND crew='$fetch->crew'"); }else{ $bb = mysql_query("SELECT * FROM replys WHERE idto='$viewtopic' forum='$forum'"); } while($success1 = mysql_fetch_row($bb)){ [color=red]line105[/color] $username11 = $success1[1]; $text = $success1[2]; $made1 = $success1[5]; } ?> Link to comment https://forums.phpfreaks.com/topic/53861-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/ Share on other sites More sharing options...
chigley Posted June 1, 2007 Share Posted June 1, 2007 You query is failing. <?php if ($crew =="1") { $bb = mysql_query("SELECT * FROM replys WHERE idto='$viewtopic' forum='$forum' AND crew='$fetch->crew'") or die(mysql_error()); }else{ $bb = mysql_query("SELECT * FROM replys WHERE idto='$viewtopic' forum='$forum'") or die(mysql_error()); } while($success1 = mysql_fetch_row($bb)){ [color=red]line105[/color] $username11 = $success1[1]; $text = $success1[2]; $made1 = $success1[5]; } ?> Link to comment https://forums.phpfreaks.com/topic/53861-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/#findComment-266254 Share on other sites More sharing options...
justoneguy Posted June 1, 2007 Author Share Posted June 1, 2007 thanks for your help but now it shows this You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'forum=''' at line 1 Link to comment https://forums.phpfreaks.com/topic/53861-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/#findComment-266259 Share on other sites More sharing options...
chigley Posted June 1, 2007 Share Posted June 1, 2007 <?php if ($crew =="1") { $bb = mysql_query("SELECT * FROM replys WHERE idto='$viewtopic' && forum='$forum' AND crew='$fetch->crew'") or die(mysql_error()); }else{ $bb = mysql_query("SELECT * FROM replys WHERE idto='$viewtopic' && forum='$forum'") or die(mysql_error()); } while($success1 = mysql_fetch_row($bb)){ [color=red]line105[/color] $username11 = $success1[1]; $text = $success1[2]; $made1 = $success1[5]; } ?> Link to comment https://forums.phpfreaks.com/topic/53861-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/#findComment-266262 Share on other sites More sharing options...
justoneguy Posted June 1, 2007 Author Share Posted June 1, 2007 thanks Link to comment https://forums.phpfreaks.com/topic/53861-warning-mysql_fetch_row-supplied-argument-is-not-a-valid-mysql-result-resour/#findComment-266265 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.