Initial commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
include "db_config.php";
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$data = json_decode(file_get_contents("php://input"), true);
|
||||
$id = isset($data['id']) ? intval($data['id']) : 0;
|
||||
|
||||
if ($id <= 0) {
|
||||
echo json_encode(["status" => "error", "message" => "ID tidak valid"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM spbu WHERE id=$id";
|
||||
|
||||
if ($conn->query($sql)) {
|
||||
echo json_encode(["status" => "success"]);
|
||||
} else {
|
||||
echo json_encode(["status" => "error", "message" => $conn->error]);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user