Jump to content

need another pair of eyes


RyanSF07

Recommended Posts

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

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);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.