mirror of
https://github.com/rekywhyd/gis_tugas.git
synced 2026-07-07 02:13:07 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
include 'config.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$nama = mysqli_real_escape_string($conn, $_POST['nama']);
|
||||
$status = $_POST['status'];
|
||||
$coords = $_POST['coords'];
|
||||
$panjang = $_POST['panjang'];
|
||||
|
||||
$query = "INSERT INTO data_jalan (nama_jalan, status_jalan, geojson_data, panjang_jalan)
|
||||
VALUES ('$nama', '$status', '$coords', '$panjang')";
|
||||
|
||||
if (mysqli_query($conn, $query)) {
|
||||
echo json_encode(['status' => 'success']);
|
||||
} else {
|
||||
echo json_encode(['status' => 'error', 'message' => mysqli_error($conn)]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user