mercredi 22 juillet 2020

when i am trying to insert values in phpmyadmin with php code nothing happens

when i try to insert any values with php in phpmyadmin nothing happens i have search in a lot of website but i have found no solution

<?php 
$bdd = new PDO('mysql:host=localhost;dbname=test exbook;charset=utf8', 'root', '');
$reponse = $bdd ->query('SELECT * FROM registration');
while($donnees = $reponse->fetch()){
    echo '<p>'. $donnees['Nom'] . '<p>';
}
$nom=$_POST['nom'];
$birthday=$_POST['birthday'];
$genre=$_POST['genre'];
$email=$_POST['email'];
$password=$_POST['password'];
$req = $bdd ->prepare('INSERT INTO registration(`Nom`, `Date de naissance`, `Genre`, `Email`, `Password`, `ID`) VALUES(?,?,?,?,?)');
$req->execute(array($nom,$birthday,$genre,$email,$password));
?>   

it give no error but when i go to php my admin nothing change i mean no values are inserted (i am sorry fo my bad english thanks for reading this and i hope u r having a nice day :o) )




Aucun commentaire:

Enregistrer un commentaire