Please help, is this the correct thing to do? The user is not created in the mysql database.
<?php
session_start();
if( isset($_SESSION['KlantNr']) ){
header("Location: /");
}
require 'database.php';
$message = '';
if(!empty($_POST['EmailAdres'])
&& !empty($_POST['password'])
&& !empty($_POST['KlantVoornaam'])
&& !empty($_POST['KlantAchternaam'])
&& !empty($_POST['Adres'])
&& !empty($_POST['Postcode'])
&& !empty($_POST['Plaats'])
&& !empty($_POST['Geboortedatum'])
&& !empty($_POST['MobielNr'])):
// Enter the new user in the database
$sql = "INSERT INTO Klant ('EmailAdres', 'password', 'KlantVoornaam', 'KlantAchternaam', 'Adres', 'Postcode', 'Plaats', 'MobielNr', 'Geboortedatum')
VALUES (:EmailAdres, :password, :Klantvoornaam, :Klantachternaam, :Adres, :Postcode, :Plaats, :MobielNr, :Geboortedatum)";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':EmailAdres', $_POST['EmailAdres']);
$stmt->bindParam(':password', password_hash($_POST['password'], PASSWORD_BCRYPT));
$stmt->bindParam(':KlantVoornaam', $_POST['KlantVoornaam']);
$stmt->bindParam(':KlantAchternaam', $_POST['KlantAchternaam']);
$stmt->bindParam(':Adres', $_POST['Adres']);
$stmt->bindParam(':Postcode', $_POST['Postcode']);
$stmt->bindParam(':Plaats', $_POST['Plaats']);
$stmt->bindParam(':Geboortedatum', $_POST['Geboortedatum']);
$stmt->bindParam(':MobielNr', $_POST['MobielNr']);
if( $stmt->execute() ):
$message = 'Created user';
else:
$message = 'Error';
endif;
endif;
?>
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in C:\xampp\htdocs\register.php on line 38