1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| <!DOCTYPE html>
<head>
<title>pdo</title>
</head>
<body>
<?php
$serveur = "localhost";
$login = "root";
$password = "";
try{
$connexion = new PDO("mysql:host=$serveur;dbname:test2", $login, $password);
$connexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$insertion = "INSERT INTO Visiteurs(nom,prenom,email) VALUES('diop','mamadou ndene','wexndene94@gmail.com' ) ";
$connexion->exec($insertion);
echo'valeurs bien insererés';
}
catch(PDOException $e){
echo 'Echec: '.$e->getMessage();
}
?>
</body> |
Partager