Update file news.php

This commit is contained in:
Jan BELLON 2024-03-08 18:58:57 +00:00
parent e1553c915d
commit 1f3d5581ac

View File

@ -52,8 +52,9 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) {
$parsedown = new Parsedown();
echo "<div class='article'>";
$bdd = connect($dbhost, $dbname, $dbuser, $dbpass);
$req = $bdd->prepare("SELECT ID, titre, date, auteur, classification FROM articles WHERE ID = :article");
$req = $bdd->prepare("SELECT ID, titre, date, auteur, classification FROM articles WHERE ID = :article AND classification <= :accreditation");
$req->bindParam(":article", $article);
$req->bindParam(":accreditation", $_SESSION['accreditation']);
$req->execute();
$resultat = $req->fetchAll(PDO::FETCH_ASSOC);;