Update 2 files

- /html/editpage.php
- /html/journal.php
This commit is contained in:
Jan BELLON 2024-03-07 20:39:41 +00:00
parent 96ca096381
commit ce88b209f2
2 changed files with 3 additions and 2 deletions

View File

@ -119,7 +119,8 @@ if(isset($fichier)) {
echo "</div></div><div>";
echo "<div><h2>Articles</h2></div>";
$bdd = connect($dbhost, $dbname, $dbuser, $dbpass);
$req = $bdd->prepare("SELECT ID, titre, auteur, date FROM articles ORDER BY date DESC LIMIT 10");
$req = $bdd->prepare("SELECT ID, titre, auteur, date FROM articles WHERE role <= :role ORDER BY date DESC LIMIT 10");
$req->bindParam(":role", $_SESSION['role']);
$req->execute();
$resultat = $req->fetchAll(PDO::FETCH_ASSOC);

View File

@ -56,7 +56,7 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) {
} else {
$bdd = connect($dbhost, $dbname, $dbuser, $dbpass);
$req = $bdd->prepare("SELECT ID, titre, date, auteur FROM articles WHERE role <= :role ORDER BY date DESC");
$req->bindParam(":role", $_SESSION['role'])
$req->bindParam(":role", $_SESSION['role']);
$req->execute();
$resultat = $req->fetchAll(PDO::FETCH_ASSOC);