From 16716a9b18e959ce2774762258e19a4e37289253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Thu, 25 Apr 2024 23:12:16 +0200 Subject: [PATCH] MEME --- lib/meme.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/meme.php b/lib/meme.php index 9cd4570..11145ea 100644 --- a/lib/meme.php +++ b/lib/meme.php @@ -9,8 +9,7 @@ function addMeme(string $title, string $memeText, int $imageID): array if (isLoggedIn() && fileExists($imageID) && !empty($title) && !empty($memeText) && !empty($imageID) && $imageID > 0) { $stmtMemeAdd = $mysqli->prepare('INSERT INTO Memes (AuthorID, Title, TextContent, FileID) VALUES (?, ?, ?, ?)'); $stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($title), htmlspecialchars($memeText), $imageID); - $stmtMemeAdd->execute(); - if($stmtMemeAdd->affected_rows > 0) { + if($stmtMemeAdd->execute() && $stmtMemeAdd->affected_rows > 0) { $output["Status"] = "Success"; } }