A lot of changes (that shouldn't, hopefully be breaking)

This commit is contained in:
2026-01-02 20:56:24 -07:00
parent b2c28e229d
commit 8e6a9ef156
30 changed files with 248 additions and 287 deletions

View File

@@ -13,14 +13,16 @@ $stmt = $conn0->prepare("SELECT * FROM users WHERE username = ?");
$stmt->bind_param("s", $username);
$stmt->execute();
$result = $stmt->get_result();
$stmt->close();
if ($result->num_rows != 1) exitWithMessage(json_encode(["success" => false, "message" => 'User info not found']));
$row = $result->fetch_assoc();
$user_id = $row["id"];
$stmt2 = $conn1->prepare("SELECT * FROM userdata WHERE token = ? AND id = ?");
$stmt2->bind_param("si", $token, $user_id);
$stmt2->execute();
$result2 = $stmt2->get_result();
$stmt = $conn1->prepare("SELECT * FROM userdata WHERE token = ? AND id = ?");
$stmt->bind_param("si", $token, $user_id);
$stmt->execute();
$result2 = $stmt->get_result();
$stmt->close();
if ($result2->num_rows != 1) exitWithMessage(json_encode(["success" => false, "message" => 'User info not found']));
$row2 = $result2->fetch_assoc();
@@ -29,6 +31,7 @@ $time = time();
$stmt = $conn1->prepare("UPDATE userposts SET deleted_at = ? WHERE id = ? AND userId = ? AND deleted_at = 0");
$stmt->bind_param("iii", $time, $targetId, $user_id);
$stmt->execute();
$stmt->close();
echo encrypt(json_encode(["success" => $stmt->affected_rows > 0]));