Update meme voting

This commit is contained in:
Bruno Rybársky 2024-04-27 11:57:07 +02:00
parent 8af1b6f073
commit d6b8057053

@ -106,7 +106,7 @@ function doImageUpload($inFile, $outFile): bool
function listFiles($onlyMine = true): array
{
$output = ["Status" => "Fail"];
$output = ["Status" => "Success"];
require_once "lib/account.php";
if (isLoggedIn()) {
global $mysqli;
@ -134,7 +134,7 @@ function listFiles($onlyMine = true): array
$stmt->bind_result($id, $path, $type, $uploadedAt, $uploadedByID, $uploadedBy);
$stmt->execute();
$files = array();
// Fetch the results into the bound variables
while ($stmt->fetch()) {
$files[] = [
@ -148,10 +148,7 @@ function listFiles($onlyMine = true): array
}
// Check if any results were fetched
if (!empty($files)) {
$output["Status"] = "Success";
$output["Files"] = $files;
}
$stmt->close();
}