From 3074bfc502405303371f2c293854663ef3bf38e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Thu, 25 Apr 2024 23:40:27 +0200 Subject: [PATCH] MEME --- lib/meme.php | 3 ++- pages/news/index.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/meme.php b/lib/meme.php index b513f31..c2c4b7b 100644 --- a/lib/meme.php +++ b/lib/meme.php @@ -37,7 +37,6 @@ function renderMemeGallery(): string $stmtlist = $mysqli->prepare('SELECT Memes.ID, Memes.Title, Memes.TextContent, Memes.CreatedAt, Files.Path, Files.Type, Users.Nickname FROM Memes INNER JOIN Users ON Memes.AuthorID = Users.ID INNER JOIN Files ON Memes.FileID = Files.ID'); // Execute the prepared statement - $stmtlist->execute(); $memeID = 0; $title = ""; $textContent = ""; @@ -47,6 +46,8 @@ function renderMemeGallery(): string $createdAt = ""; // Bind the result variables $stmtlist->bind_result($memeID, $title, $textContent, $createdAt, $filePath, $fileType, $userNickname); + $stmtlist->execute(); + $stmtlist->fetch(); $meme_gallery_template = file_get_contents($routerConfig['template_dir'] . 'meme_gallery.html'); diff --git a/pages/news/index.php b/pages/news/index.php index 1874828..44fa2ed 100644 --- a/pages/news/index.php +++ b/pages/news/index.php @@ -19,7 +19,7 @@ $output = str_replace("__TEMPLATE_FOR_ARTICLE_CONTENT__", $articleTemplate, $out foreach ($articles as $article){ $articleTitle = htmlspecialchars($article["Title"]); $articleBody = htmlspecialchars($article["Body"]); - $articleFileList = $article["FileList"]; + //$articleFileList = $article["FileList"]; $articleWrittenBy = $article["WrittenBy"]; $articleWrittenAt = htmlspecialchars($article["WrittenAt"]); $articleWrittenByName = htmlspecialchars($article["WrittenByName"]);