Initial commit

This commit is contained in:
Farha
2026-04-07 17:17:55 +07:00
commit 433efc4457
11 changed files with 1600 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
header('Content-Type: application/json');
include 'db_config.php';
$sql = "SELECT * FROM locations";
$result = $conn->query($sql);
$locations = [];
if (!$result) {
http_response_code(500);
echo json_encode(['status' => 'error', 'message' => 'Query gagal: ' . $conn->error]);
$conn->close();
exit;
}
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$locations[] = $row;
}
}
echo json_encode($locations);
$conn->close();
?>