31 lines
563 B
PHP
31 lines
563 B
PHP
<?php
|
|
include 'koneksi.php';
|
|
|
|
$pemilik = $_POST['pemilik'];
|
|
$status = $_POST['status'];
|
|
$luas = $_POST['luas'];
|
|
$geom = $_POST['geom'];
|
|
|
|
if(empty($pemilik) || empty($geom)){
|
|
echo "Data tidak lengkap";
|
|
exit;
|
|
}
|
|
|
|
$stmt = $conn->prepare("INSERT INTO kavling (pemilik, status, luas, geom) VALUES (?, ?, ?, ?)");
|
|
|
|
if(!$stmt){
|
|
echo "Prepare gagal: " . $conn->error;
|
|
exit;
|
|
}
|
|
|
|
$stmt->bind_param("ssds", $pemilik, $status, $luas, $geom);
|
|
|
|
if($stmt->execute()){
|
|
echo "OK";
|
|
} else {
|
|
echo "Gagal: " . $stmt->error;
|
|
}
|
|
|
|
$stmt->close();
|
|
$conn->close();
|
|
?>
|