<?php

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

error_reporting(E_ALL);
ini_set('display_errors',1);

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

$id   = $_POST['id'] ?? '';
$luas = $_POST['luas'] ?? '';
$geom = $_POST['geom'] ?? '';

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

echo json_encode([
    'success' => $query,
    'affected_rows' => mysqli_affected_rows($conn),
    'mysql_error' => mysqli_error($conn),
    'id' => $id
]);