<?php
require 'db.php';

header('Content-Type: application/json; charset=utf-8');

$sql = "SELECT id, nama_jalan, status_jalan, panjang_meter, koordinat FROM tb_jalan ORDER BY id DESC";
$stmt = $pdo->query($sql);
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);

echo json_encode($results);
