<?php

header('Content-Type: application/json');

include '../config/koneksi.php';

$id      = $_POST['id'] ?? '';
$panjang = $_POST['panjang'] ?? 0;
$geom    = $_POST['geom'] ?? '';

$query = mysqli_query(
    $conn,
    "UPDATE jalan
     SET
        panjang = '$panjang',
        geom = '$geom'
     WHERE id = '$id'"
);

echo json_encode([
    "success" => $query
]);