Advertisement
Guest User

Julie 2

a guest
Feb 12th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title> test Document <?php echo $_GET['id']?></title>
  6. </head>
  7. <body>
  8.  
  9.  
  10.  
  11.  
  12. <?php echo 'Document N°' . $_GET['id']; ?>
  13. <!-- ça marche s'il y a que la partie au dessus -->
  14.  
  15. <!-- CONNEXION BASE DE DONNEES -->
  16. <?php
  17. try
  18. {
  19. $bdd = new PDO('mysql:host=localhost;dbname=atlas;charset=utf8', 'root', 'root');
  20. }
  21. catch(Exception $e)
  22. {
  23. die('Erreur : '.$e->getMessage());
  24. }
  25.  
  26.  
  27. $req = $bdd->prepare('SELECT * FROM texte WHERE id = :iddoc');
  28. $req->execute(array('iddoc' => $_GET['id']));
  29.  
  30.  
  31. while ($document = $req->fetch())
  32. {
  33. echo $document['auteur'] ;
  34. }
  35.  
  36. $req->closeCursor();
  37.  
  38.  
  39.  
  40. ?>
  41.  
  42.  
  43.  
  44.  
  45.  
  46. </body>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement