Initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
include "db_config.php";
|
||||
|
||||
$data = json_decode(file_get_contents("php://input"), true);
|
||||
|
||||
$nama = $data['nama'];
|
||||
$no = $data['no'];
|
||||
$status = $data['status'];
|
||||
$lat = $data['lat'];
|
||||
$lng = $data['lng'];
|
||||
|
||||
$sql = "INSERT INTO spbu (nama,no,status,lat,lng)
|
||||
VALUES ('$nama','$no','$status','$lat','$lng')";
|
||||
|
||||
if($conn->query($sql)){
|
||||
echo json_encode([
|
||||
"status"=>"success",
|
||||
"id"=>$conn->insert_id
|
||||
]);
|
||||
}else{
|
||||
echo json_encode(["status"=>"error"]);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user