From 73327505beb75748a8a86e5719063c15b32b4a1f Mon Sep 17 00:00:00 2001 From: Freya_Martines Date: Fri, 12 Jun 2026 17:50:53 +0000 Subject: [PATCH] Upload files to "/" --- ambil.php | 15 +++++---------- ambil_jalan.php | 11 ++++++----- ambil_kavling.php | 11 ++++++----- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/ambil.php b/ambil.php index e689f4b..9a06e2f 100644 --- a/ambil.php +++ b/ambil.php @@ -1,13 +1,8 @@ query("SELECT * FROM spbu"); - +require_once 'koneksi.php'; +header('Content-Type: application/json'); +$result = $conn->query("SELECT * FROM spbu ORDER BY id DESC"); $data = []; - -while($row = $result->fetch_assoc()){ - $data[] = $row; -} - +while ($row = $result->fetch_assoc()) { $data[] = $row; } echo json_encode($data); -?> \ No newline at end of file +?> diff --git a/ambil_jalan.php b/ambil_jalan.php index fd73aa6..0d99d12 100644 --- a/ambil_jalan.php +++ b/ambil_jalan.php @@ -1,7 +1,8 @@ query("SELECT * FROM jalan"); -$data=[]; -while($row=$result->fetch_assoc()) $data[]=$row; +require_once 'koneksi.php'; +header('Content-Type: application/json'); +$result = $conn->query("SELECT * FROM jalan ORDER BY id DESC"); +$data = []; +while ($row = $result->fetch_assoc()) { $data[] = $row; } echo json_encode($data); -?> \ No newline at end of file +?> diff --git a/ambil_kavling.php b/ambil_kavling.php index a71e3e5..d2f2246 100644 --- a/ambil_kavling.php +++ b/ambil_kavling.php @@ -1,7 +1,8 @@ query("SELECT * FROM kavling"); -$data=[]; -while($row=$result->fetch_assoc()) $data[]=$row; +require_once 'koneksi.php'; +header('Content-Type: application/json'); +$result = $conn->query("SELECT * FROM kavling ORDER BY id DESC"); +$data = []; +while ($row = $result->fetch_assoc()) { $data[] = $row; } echo json_encode($data); -?> \ No newline at end of file +?>