I know there are some questions about this on Stackoverflow but I tried them and they don't worked out. I want to insert some Variables into an Mysql Database with PDO and prepared statements to prevent the Website from being SQL Injectet.
The Complete Warning is this: Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in SignUpBet.N.php on line 33
$pdo = new PDO('mysql:host=127.0.0.1;dbname=JobBlocks', 'root', '');
$name = htmlspecialchars($_POST['name'], ENT_QUOTES);
$passwort1 = htmlspecialchars($_POST['passwort'], ENT_QUOTES);
$passwort = password_hash($passwort1, PASSWORD_DEFAULT);
$email = htmlspecialchars($_POST['email'], ENT_QUOTES);
if (empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
die("Die Email-Adresse war ungültig");
}
$telnummer = htmlspecialchars($_POST['telnummer'], ENT_QUOTES);
$straße = htmlspecialchars($_POST['straße'], ENT_QUOTES);
$hausnummer = htmlspecialchars($_POST['hausnummer'], ENT_QUOTES);
$postleitzahl = htmlspecialchars($_POST['postleitzahl'], ENT_QUOTES);
$region = htmlspecialchars($_POST['region'], ENT_QUOTES);
$gattung = 2;
$statement = $pdo->prepare("INSERT INTO Login(pwd,nam,eMail,TNummer,Straße,Hausnummer,Postleitzahl,Region,Gattung) VALUES(:passwort, :name, :eMail, :tellnummer, :straße, :hausnummer, :postleitzahl, :region, :gattung)");
$statement->bindValue(':passwort', $passwort);
$statement->bindValue(':name', $name);
$statement->bindValue(':eMail', $email);
$statement->bindValue(':tellnummer', $telnummer);
$statement->bindValue(':straße', $straße);
$statement->bindValue(':hausnummer', $hausnummer);
$statement->bindValue(':postleitzahl', $postleitzahl);
$statement->bindValue(':region', $region);
$statement->bindValue(':gattung', $gattung);
$statement->execute();