From 4f1e3c673f56d4522494d07152caf054feddad43 Mon Sep 17 00:00:00 2001 From: Jan BELLON Date: Fri, 8 Mar 2024 19:08:48 +0000 Subject: [PATCH] Update file news.php --- html/news.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/news.php b/html/news.php index bf930bcd..e2fb168b 100644 --- a/html/news.php +++ b/html/news.php @@ -48,14 +48,14 @@ 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 AND classification <= :accreditation ORDER BY date DESC"); + $req = $bdd->prepare("SELECT ID, titre, date FROM articles WHERE (titre LIKE :search OR ID LIKE :search) AND classification <= :accreditation ORDER BY date DESC"); $req->bindParam(":search", $search); $req->bindParam(":accreditation", $_SESSION['accreditation']); $req->execute(); $resultat = $req->fetchAll(PDO::FETCH_ASSOC); echo "

Dernières news du Club

"; - echo "
"; + echo "
"; if ($resultat) { foreach($resultat as $row) {