我需要使用更新准备好的语句来更新mysqli
中的某些数据。所有输入都有效(意味着它们已填充),但我仍然收到此错误
致命错误:未被捕获的错误:在布尔值上调用成员函数bind_param()
我已经尝试过:
$stmt = $conn->prepare("UPDATE users SET nickname=?, email=?, password=?, newsletters=? WHERE email='".$_SESSION["email"]."'");
$stmt->bind_param("sssi", $stmtnickname, $stmtemail, $stmtpassword, $stmtnewsletters);
$stmtnickname = $newnickname;
$stmtemail = $newemail;
$stmtpassword = $newpassword;
$stmtnewsletters = $newnewsletters;
$stmt->execute();
echo '<script>alert("Osobní údaje změněny.");</script>';
$stmt->close();