Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $recherche = htmlspecialchars($_GET['search']);
- try
- {
- $bdd = new PDO('infos de connexion');
- }
- catch(Exception $e)
- {
- die('Erreur : '.$e->getMessage());
- }
- $requete = $bdd->prepare('SELECT * FROM Recherche WHERE CONTENU LIKE ?');
- $requete->execute(array('%' . $recherche .'%'));
- while ($donnees = $requete->fetch())
- {
- echo "<p>" . $donnees['TITRE'] . "</p>";
- }
- $requete->closeCursor();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement