我有我的代码问题,我不明白什么是真的错了。 我想对登录ID从表中数据库中的用户ID,但它给)mysql_fetch_assoc()期望参数1是给定的资源数组
mysql_fetch_assoc的错误(预计参数1是资源数组给定 .....
调用的功能...
$login_id= $_SESSION['a_id'];
$result=$add_task -> get_id_from_login_id($login_id);
while($id=mysql_fetch_assoc($result)) {
echo $id;
}
,并在功能我有这样的代码
$SQL="SELECT id FROM admin WHERE LoginID='$login_id'";
return $this->execute_sql($SQL);
没有MySQL的功能得到已过时年前? – 2013-07-25 08:56:16
错误信息的哪部分不清楚?如果你写了'mysql_fetch_assoc('hello world')'你会期望这个工作吗? – Jon
我建议你阅读[this](http://stackoverflow.com/questions/60174/how-to-prevent-sql-injection-in-php)。 –