query("SELECT * FROM spbu ORDER BY id DESC"); $data = []; while ($row = $result->fetch_assoc()) { $data[] = $row; } echo json_encode($data); ?>