Warning: mysql

Possible Duplicate:
PHP: Warning: sort() expects parameter 1 to be array, resource given

The error is "Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in [...] on line 39", line 39 is "$row = mysql_fetch_array($result);". I'm freaking out, what's wrong with it?


mysql_query failed and returned FALSE in $result .

You should check the returned value:

$id = mysql_real_escape_string($GET["id"]);
if ($result = mysql_query("SELECT * FROM Setting WHERE ID = '$id'"))
    $row = mysql_fetch_array($result);
else
    print htmlencode(mysql_error()) . "n";

And of course you should never put $GET["id"] right into the query:

链接地址: http://www.djcxy.com/p/69218.html

上一篇: 警告:mysql

下一篇: 警告:mysql