<?php
include '../connection.php';

$sql = "SELECT * FROM tbl_notifications ORDER BY created_at DESC LIMIT 20";
$result = $conn->query($sql);

$notifications = [];

while($row = $result->fetch_assoc()) {
    $notifications[] = $row;
}

echo json_encode(["success" => true, "notifications" => $notifications]);
