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 Quote Link to comment 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); Quote Link to comment 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 Quote Link to comment 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); Quote Link to comment 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.