From 7da94c06d4899195ebb389eccf64b10d3c866e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Thu, 25 Apr 2024 22:55:00 +0200 Subject: [PATCH] MEME --- lib/meme.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/meme.php b/lib/meme.php index c649a08..b386a24 100644 --- a/lib/meme.php +++ b/lib/meme.php @@ -10,7 +10,9 @@ function addMeme(string $title, string $memeText, int $imageID): array $stmtMemeAdd = $mysqli->prepare('INSERT INTO Memes (AuthorID, Title, TextContent, FileID) VALUES (?, ?, ?, ?)'); $stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($title), htmlspecialchars($memeText), $imageID); $stmtMemeAdd->execute(); - $output["Status"] = "Success"; + if($stmtMemeAdd->affected_rows > 0) { + $output["Status"] = "Success"; + } } return $output; }