0
我试图创建一个使用从以前的页面发布数据的INSERT语句,并将其绑定到声明错误绑定参数在PHP /库MySQLi
我的SQL INSERT语句是这样的:
// insert new user
$db = createConnection();
$insertquery="insert into comments (com, userid, comdate, blogpost) values (?,?,?,?)";
$inst=$db->prepare($insertquery);
$inst->bind_param("sisi", $comment, $user, $today, $id);
$inst->execute();
$inst->close();
当我打开调试PHP这是错误我收到
Fatal error: Call to a member function bind_param() on boolean in /blog/xcomment.php on line 29
正在传递中的bind_param的数据
Array ([comment] => My New Comment [blogid] => 1) 2016-01-07 12:31:50
$user = $currentuser['userlevel'];
$comment = $_POST['comment'];
$id = $_POST['blogid'];
$today = date("Y-m-d H:i:s");