RyanSF07 Posted July 10, 2007 Share Posted July 10, 2007 Hi Guys, I'm getting this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result on this code: $result = mysql_query("SELECT * FROM $table WHERE id=$id",$db); $myrow = mysql_fetch_array($result); ?> do I have apostrophe's in the wrong place? thanks for your help. Ryan Link to comment https://forums.phpfreaks.com/topic/59345-need-another-pair-of-eyes/ Share on other sites More sharing options...
gevo12321 Posted July 10, 2007 Share Posted July 10, 2007 try this $result = mysql_query("SELECT * FROM $table WHERE id=$id"); $myrow = mysql_fetch_array($result); Link to comment https://forums.phpfreaks.com/topic/59345-need-another-pair-of-eyes/#findComment-294815 Share on other sites More sharing options...
teng84 Posted July 10, 2007 Share Posted July 10, 2007 hmmm try this "SELECT * FROM ".$table." WHERE id=".$id."" the code you seems ok but try that one Link to comment https://forums.phpfreaks.com/topic/59345-need-another-pair-of-eyes/#findComment-294816 Share on other sites More sharing options...
AndyB Posted July 10, 2007 Share Posted July 10, 2007 Better yet, add some error trapping so you will know just why the query is failing: $query = "SELECT * FROM $table WHERE id = '$id'"; $result = mysql_query($query) or die("Error: ". mysql_error(). " with query ". $query); $myrow = mysql_fetch_array($result); Link to comment https://forums.phpfreaks.com/topic/59345-need-another-pair-of-eyes/#findComment-294839 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.