i am still a beginner in web developing and we were asked to make a simple website with a login and a database , however i am facing a problem in a sql query on the sign in page , here's my code :
<?php
$data_src=new PDO("mysql:host=localhost;dbname=mini_projet",'root','');
$req = $data_src->prepare('INSERT INTO utilisateur values(:identifiant,:nom,:prénom,:email,:motdp)');
$req->execute(array(
'identifiant'=>$_POST['id'],
'nom'=>$_POST['nom'],
'prénom'=>$_POST['prenom'],
'email'=>$_POST['email'],
'motdp'=>$_POST['pwd']));
echo '<a href="forum.php">vous avez inscrit avec sucée cliquez ici</a>';
?>
and after i submit the information on the sign in page, i get this error :
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in C:\wamp64\www\chat\inscri.php on line 9
'motdp'=>$_POST['pwd'] seems to be causing this problem but i can't figure what's wrong , the database and the web page are both fine.