mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in php [duplicate]
Possible Duplicate:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
$query = "SELECT UniqueID FROM configuration";
$result = mysql_query($query)or die(mysql_error());;
while($row = mysql_fetch_assoc($result)) { }
throwing exception as
Warning:
mysql_fetch_assoc()
: supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Group\Apache2\htdocs\ehp\hello.php on line 10
That's slightly confusing, since this sort of thing is usually caused by an SQL error, however the line ..or die(mysql_error());
should have picked that up. Check the contents of your loop that you're not overwriting the $result
variable.
精彩评论