diff --git a/html/news.php b/html/news.php
index 4932eba7..2461584c 100644
--- a/html/news.php
+++ b/html/news.php
@@ -51,23 +51,20 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) {
require_once '../include/parsedown.php';
$parsedown = new Parsedown();
echo "
";
- bdd = connect($dbhost, $dbname, $dbuser, $dbpass);
- $req = $bdd->prepare("SELECT ID, titre, date, auteur, classification FROM articles WHERE classification <= :accreditation ORDER BY date DESC");
- $req->bindParam(":accreditation", $_SESSION['accreditation']);
+ $bdd = connect($dbhost, $dbname, $dbuser, $dbpass);
+ $req = $bdd->prepare("SELECT ID, titre, date, auteur, classification FROM articles WHERE ID = :article");
+ $req->bindParam(":article", $article);
$req->execute();
- $resultat = $req->fetchAll(PDO::FETCH_ASSOC);
-
- $date = new Datetime($row['date']);
+ $resultat = $req->fetchAll(PDO::FETCH_ASSOC);;
if ($resultat) {
- foreach($resultat as $row) {
- echo "
";
- echo "
" . $row['ID'] . "
";
- echo "
" . $row['titre'] . "
";
- echo "
" . $date->format('d/m/Y') . "
";
- echo "
" . $row['auteur'] . "
";
- echo "
" . $row['classification'] . "
";
- }
+ $date = new Datetime($row[0]['date'])
+ echo "
";
+ echo "
" . $row[0]['ID'] . "
";
+ echo "
" . $row[0]['titre'] . "
";
+ echo "
" . $date->format('d/m/Y') . "
";
+ echo "
" . $row[0]['auteur'] . "
";
+ echo "
" . $row[0]['classification'] . "
";
}
echo "
";
echo $parsedown->text($markdownContent);