<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json");

require_once "koneksi.php";

$id = $_GET['id'] ?? 0;

$stmt = $conn->prepare("DELETE FROM informasi WHERE id = ?");
$stmt->bind_param("i", $id);

if ($stmt->execute()) {
    echo json_encode(["success" => true]);
} else {
    echo json_encode(["success" => false, "msg" => $conn->error]);
}

$stmt->close();
$conn->close();
?>