开发者

mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in php [duplicate]

This question already has answers here: 开发者_JS百科 Closed 10 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜