mirror of
https://git.sr.ht/~iwakuralain/text0Nly
synced 2025-07-27 15:36:11 +00:00
whoopsie x2
This commit is contained in:
parent
0845621f0e
commit
d5b33ff00d
@ -18,8 +18,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
|||||||
$limit = min(max(1, $limit), 100);
|
$limit = min(max(1, $limit), 100);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$stmt = $db->prepare('SELECT username, message, created_at, signature, is_encrypted FROM messages ORDER BY created_at DESC LIMIT ?');
|
$stmt = $db->query("SELECT username, message, created_at, signature, is_encrypted FROM messages ORDER BY created_at DESC LIMIT $limit");
|
||||||
$stmt->execute([$limit]);
|
|
||||||
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
echo json_encode(['messages' => $messages]);
|
echo json_encode(['messages' => $messages]);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user