$stmt = $mysqli->prepare('select Un from member where Lock = ? and Activated = ?');
$stmt -> bind_param("ss", 'N', 'Y');//This line gave the error
$stmt -> execute();
$stmt->store_result();//apply to prepare statement
$numRows = $stmt->num_rows;
if ($numRows > 0)//if have result
while ($row = $stmt->fetch())
我上面的代码给了我“在非对象上调用成员函数bind_param()”]错误。我真的不明白为什么我得到这个错误。我有正确的列名。
我是mysqli的新手,想学习如何调试这种错误。
$ stmt = $ mysqli-> prepare('从其中Lock =?和Activated =?的成员中选择Un。); $ stmt-> bind_param(“ ss”,'N','Y'); //此行给出了错误$ stmt-> execute(); $ stmt-> store_result(); ...
Call to a member function bind_param() on a non-object
表示您试图调用$stmt
on
[
$mysqli->error()
返回语句对象,如果发生错误,则返回$stmt->bind_param("ss", 'N', 'Y');//This line gave the error
。