Update file editpage.php
This commit is contained in:
parent
145d8b1041
commit
f32c49b2b0
@ -170,11 +170,10 @@ if(isset($fichier)) {
|
|||||||
$condition = "";
|
$condition = "";
|
||||||
if(isset($_GET['search'])) {
|
if(isset($_GET['search'])) {
|
||||||
$search = "%" . htmlspecialchars($_GET['search']) . "%";
|
$search = "%" . htmlspecialchars($_GET['search']) . "%";
|
||||||
$condition = "AND (titre LIKE " . $search . " OR ID LIKE " . $search . ")";
|
$condition = "AND (titre LIKE " . $search . " OR ID LIKE " . $search . ") ";
|
||||||
}
|
}
|
||||||
$req = $bdd->prepare("SELECT ID, titre, date FROM articles WHERE classification <= :accreditation :condition ORDER BY date DESC LIMIT 10");
|
$req = $bdd->prepare("SELECT ID, titre, date FROM articles WHERE classification <= :accreditation " . $condition . "ORDER BY date DESC LIMIT 10");
|
||||||
$req->bindParam(":accreditation", $_SESSION['accreditation']);
|
$req->bindParam(":accreditation", $_SESSION['accreditation']);
|
||||||
$req->bindParam(":condition", $condition);
|
|
||||||
$req->execute();
|
$req->execute();
|
||||||
$resultat = $req->fetchAll(PDO::FETCH_ASSOC);
|
$resultat = $req->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user