add file
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
include 'db.php';
|
||||
|
||||
$data = json_decode(file_get_contents("php://input"), true);
|
||||
$id = (int)($data['id'] ?? 0);
|
||||
$panjang = floatval($data['panjang'] ?? 0);
|
||||
$geometry = $conn->real_escape_string(json_encode($data['geometry']));
|
||||
|
||||
if ($conn->query("UPDATE jalan SET panjang='$panjang', geometry='$geometry' WHERE id=$id")) {
|
||||
echo json_encode(['success' => true]);
|
||||
} else {
|
||||
echo json_encode(['success' => false, 'error' => $conn->error]);
|
||||
}
|
||||
Reference in New Issue
Block a user