【发布时间】:2017-04-16 08:26:53
【问题描述】:
请朋友们帮帮我。我不知道哪里出错了。到目前为止我需要更新的所有变量都很好,但是实际的更新语句返回一个错误说
“未捕获的错误:在 null 上调用成员函数 prepare()”
下面是我的一小段php代码:
$name_image=basename($_FILES[$idx]["name"]["$key"]);
$time = date("Y-m-d H:i:s");
$email_insert = $_SESSION['email'];
$sql_upl ="UPDATE forepost_users SET profile_picture ='$name_image',lastmodified ='$time' WHERE email_address=?";
$SQL_statement_upl= $this->conn->prepare($sql_upl);
$SQL_statement_upl->bindParam(1,$email_insert);
$SQL_statement_upl->execute();
【问题讨论】:
-
这个
SET profile_picture ='$name_image',lastmodified ='$time'不会将$name_image和$time值插入到您准备好的语句中。而是将它们绑定为参数? -
谢谢让我试试
-
你应该 var_dump
$this->conn并确保它返回你所期望的
标签: php jquery sql-server