Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <title>Saisie contact</title>
- </head>
- <body>
- <?php
- $server = "localhost";
- $db = "coursPHP";
- $login = "root";
- $mdp = "";
- //Connexion au serveur MySQL
- try {
- $connexPDO = new PDO("mysql:host=$server;dbname=$db", $login, $mdp);
- }
- catch (Exception $e) {
- die('Erreur : ' . $e->getMessage());
- }
- //Préparation de la requête
- $req = $connexPDO->prepare('INSERT INTO patient(ID_patient, civilite_patient, nom_patient, prenom_patient, adresse, code_postal, ville, date_naissance, lieu_naissance, num_secu, ID_medecin)
- VALUES(:ID_patient, :civilite_patient, :nom_patient, :prenom_patient, :adresse, :code_postal, :ville, :date_naissance, :lieu_naissance, :num_secu, :ID_medecin)');
- //Exécution de la requête
- $req->execute(array('ID_patient' => $_POST['ID_patient'],
- 'civilite_patient' => $_POST['civilite_patient'],
- 'nom_patient' => $_POST['nom_patient'],
- 'prenom_patient' => $_POST['prenom_patient'],
- 'adresse' => $_POST['adresse'],
- 'code_postal' => $_POST['code_postal'],
- 'ville' => $_POST['ville'],
- 'date_naissance' => $_POST['date_naissance'],
- 'lieu_naissance' => $_POST['lieu_naissance']
- 'num_secu' => $_POST['num_secu'],
- 'ID_medecin' => $_POST['ID_medecin']));
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement