bonjour, je veux enregistrer des info dans ma base, mais il rien n'y vas,et il n'affiche aucune erreur,
voici le code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<body>
<br>Pour vous inscrire remplissez ces cases :<br>
<form method="post" action="insertpdo.php">
Nom : <input type="text" name="nom">&nbsp;&nbsp;&nbsp;
Email : <input type="text" name="email">&nbsp;&nbsp;&nbsp;
<input type="submit" name="submit" value="Je valide mon inscription">
</form>
<?php
if(isset($nom)){
$nom=$_POST['nom'];
$email=$_POST['email'];
try{
	$connexion=new PDO('mysql:host=localhost;dbnane=test','root','');
}
catch(PDOExcetion $e){
	die("Erreur de connexion".$e->getMessage());
}
$req=$connexion->prepare("INSERT INTO gens (nom,email) VALUES(:nom,:email)");
$req->execute(array('nom'=>$nom,'email'=>$email))
$connexion = NULL;
}
?>
</body>