0
我正在尝试为我的项目创建一个登录系统,但在登录期间发生错误。错误说'next()期望参数1是数组,布尔给定'。next()期望参数1是数组,布尔值给出
public function login(Customer $c) {
$sql = "select * from customer where username = ? and password = ?";
try {
$username = $c -> getUsername();
$password = $c -> getPassword();
$stmt = $this -> getConnection() -> prepare($sql);
$stmt -> bind_param('ss', $username, $password);
$res = $stmt -> execute();
while (next($res)) {//error occurred on this line
return true;
}
} catch (SQLiteException $ex) {
echo $ex;
}
return false;
}
查阅文档,看看有什么可能的值'$ stmt->的execute()'可能会返回... –