このコードで失敗した場所が見つかりません
$username = $_POST["UserID"];
$password = $_POST["PWD"];
$sql = 'select COUNT(*) from Staff where UserID = :UserID and PWD = :PWD';
$result = $cnnEmployee->prepare($sql);
$result->bindParam(':UsedID',$username, PDO::PARAM_STR)
$result->bindParam(':PWD',$password, PDO::PARAM_STR)
$result->execute(); //Error here: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: parameter was not defined'
しかし、私がに変更した場合
$username = $_POST["UserID"];
$password = $_POST["PWD"];
$sql = 'select COUNT(*) from Staff where UserID = :UserID and PWD = :PWD';
$result = $cnnEmployee->prepare($sql);
$result->execute(array(':UserID'=>$username, ':PWD'=>$password));
それはうまくいきます Plsは私の問題がどこにあるかを見つけるのを手伝ってくれます.