Initial commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
include "db_config.php";
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$sql = "SELECT
|
||||
id,
|
||||
nama_rumah_ibadah AS nama_masjid,
|
||||
penanggung_jawab AS pic_masjid,
|
||||
alamat AS alamat_masjid,
|
||||
radius,
|
||||
lat,
|
||||
lng,
|
||||
created_at,
|
||||
updated_at
|
||||
FROM rumah_ibadah";
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if (!$result) {
|
||||
echo json_encode([
|
||||
"status" => "error",
|
||||
"message" => "Gagal membaca tabel rumah ibadah",
|
||||
"detail" => $conn->error
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
||||
while($row = $result->fetch_assoc()){
|
||||
$data[] = $row;
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
?>
|
||||
Reference in New Issue
Block a user