<?php

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

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

$db = getDB();

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

FROM orders

ORDER BY id DESC");

$orders = [];

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

    $orders[] = $row;
}

echo json_encode([

    "success" => true,

    "orders" => $orders
]);