From 78a06195a6bdd6321008676a3cf89e61a4ca7e3f Mon Sep 17 00:00:00 2001 From: Jan BELLON Date: Fri, 8 Mar 2024 19:19:23 +0000 Subject: [PATCH] Update file news.php --- html/news.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/news.php b/html/news.php index 21d1fb87..6136a60d 100644 --- a/html/news.php +++ b/html/news.php @@ -48,7 +48,7 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) { if ($article == "") { $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); $search = isset($_GET['search']) ? htmlspecialchars($_GET['search']) : ""; - $req = $bdd->prepare("SELECT ID, titre, date FROM articles WHERE (titre LIKE :search OR ID LIKE '%:search%' OR auteur LIKE :search) AND classification <= :accreditation ORDER BY date DESC"); + $req = $bdd->prepare("SELECT ID, titre, date FROM articles WHERE (titre LIKE :search OR ID LIKE '% :search %' OR auteur LIKE :search) AND classification <= :accreditation ORDER BY date DESC"); $req->bindParam(":search", $search); $req->bindParam(":accreditation", $_SESSION['accreditation']); $req->execute();