<?php
header("Content-Type: application/json");
 require_once __DIR__ . '/config/config.php';

$sql = "SELECT * FROM deposits ORDER BY id DESC";
$result = $conn->query($sql);

$deposits = [];

if ($result->num_rows > 0) {
  while ($row = $result->fetch_assoc()) {
    $deposits[] = $row;
  }
}

echo json_encode($deposits);
$conn->close();
?>
