Update file news.php
This commit is contained in:
parent
b92e36da5f
commit
e1553c915d
@ -69,9 +69,9 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) {
|
||||
echo "</div></div>";
|
||||
} else {
|
||||
$bdd = connect($dbhost, $dbname, $dbuser, $dbpass);
|
||||
$search = isset($_GET['search']) ? htmlspecialchars($_GET['search']) : "";
|
||||
$req = $bdd->prepare("SELECT ID, titre, date FROM articles WHERE classification <= :accreditation AND titre LIKE '%:search%'ORDER BY date DESC");
|
||||
$req->bindParam(":search", htmlspecialchars($_GET['search']));
|
||||
$search = isset($_GET['search']) ? "'%" . htmlspecialchars($_GET['search']) . "%'" : "'%'";
|
||||
$req = $bdd->prepare("SELECT ID, titre, date FROM articles WHERE classification <= :accreditation AND titre LIKE :search ORDER BY date DESC");
|
||||
$req->bindParam(":search", $search);
|
||||
$req->bindParam(":accreditation", $_SESSION['accreditation']);
|
||||
$req->execute();
|
||||
$resultat = $req->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
Loading…
x
Reference in New Issue
Block a user