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