Initial commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
ini_set('display_errors', 0);
|
||||
|
||||
include 'db.php';
|
||||
|
||||
if (!isset($conn) || $conn->connect_error) {
|
||||
http_response_code(500);
|
||||
echo json_encode(['error' => 'Database connection failed']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$result = $conn->query("SELECT * FROM data_unified WHERE tipe IN ('point','worship','poor_house')");
|
||||
|
||||
if (!$result) {
|
||||
http_response_code(500);
|
||||
echo json_encode(['error' => $conn->error]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
while($row = $result->fetch_assoc()){
|
||||
$data[] = $row;
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
?>
|
||||
Reference in New Issue
Block a user