Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php
  2.     $recherche = htmlspecialchars($_GET['search']);
  3.     try
  4.     {
  5.         $bdd = new PDO('infos de connexion');
  6.     }
  7.     catch(Exception $e)
  8.     {
  9.         die('Erreur : '.$e->getMessage());
  10.     }
  11.     $requete = $bdd->prepare('SELECT * FROM Recherche WHERE CONTENU LIKE ?');
  12.     $requete->execute(array('%' . $recherche .'%'));
  13.     while ($donnees = $requete->fetch())
  14.     {
  15.         echo "<p>" . $donnees['TITRE'] . "</p>";
  16.     }
  17.     $requete->closeCursor();
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement