Initial commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include "db_config.php";
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$sql = "SELECT * FROM laporan_masyarakat ORDER BY created_at DESC";
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if (!$result) {
|
||||
echo json_encode(["status" => "error", "message" => "Gagal membaca tabel laporan_masyarakat", "detail" => $conn->error]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$data[] = $row;
|
||||
}
|
||||
echo json_encode($data);
|
||||
?>
|
||||
Reference in New Issue
Block a user