<?php

header("Content-Type: application/json");

require_once("../config/database.php");

$db = getDB();

$result =
$db->query("SELECT *

FROM notifications

ORDER BY id DESC");

$list = [];

while($row =
$result->fetch_assoc()){

$list[] = $row;
}

echo json_encode([

"success" => true,

"notifications" => $list
]);