Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. $title=$_POST['title'];
  4. $start=$_POST['start'];
  5. $end=$_POST['end'];
  6.  
  7. // connexion à la base de données
  8. try {
  9. $bdd = new PDO('mysql:host=localhost;dbname=osteo-dijon', 'root', '');
  10. } catch(Exception $e) {
  11. exit('Impossible de se connecter à la base de données.');
  12. }
  13.  
  14. $sql = "INSERT INTO agenda (title, start, end) VALUES (:title, :start, :end)";
  15. $q = $bdd->prepare($sql);
  16. $q->execute(array(':title'=>$title, ':start'=>$start, ':end'=>$end));
  17.  
  18.  
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement