0
ログインシステムをプロジェクトに作成しようとしていますが、ログイン中にエラーが発生しました。エラーは 'next()はパラメータ1が配列で、ブール値が与えられると期待しています'と言っています。next()は、パラメータ1が配列で、booleanが指定されています。
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->実行()'を返す可能性のあるものを値を参照するマニュアルを参照してください... –