$idsql = "Select id from Employee where name = :username and surname = :usersurname and middlename = :usermiddlename and phone = :userphone and email = :useremail and password = :userpassword";
$stmt = $conn -> prepare($idsql);
$stmt -> bindValue(":username", $_POST["name"], PDO::PARAM_STR);
$stmt -> bindValue(":usersurname", $_POST["surname"], PDO::PARAM_STR);
$stmt -> bindValue(":usermiddlename", $_POST["middlename"], PDO::PARAM_STR);
$stmt -> bindValue(":userphone", $_POST["phone"], PDO::PARAM_INT);
$stmt -> bindValue(":useremail", $_POST["email"], PDO::PARAM_STR);
$stmt -> bindValue(":userpassword", $_POST["password1"], PDO::PARAM_STR);
$stmt -> execute();
if($stmt -> rowCount() > 0){
foreach($stmt as $row){
echo "Пользователь успешно авторизован, теперь зайдите под своим id и паролём.<br><h1>Ваш id - " . $row["id"] . "</h1>";
}
}
/*SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'field list'*/