15 lines
434 B
PHP
15 lines
434 B
PHP
<?php
|
|
include '../koneksi.php';
|
|
header('Content-Type: application/json');
|
|
|
|
$id = (int)($_POST['id'] ?? $_GET['id'] ?? 0);
|
|
if (!$id) { echo json_encode(['status'=>'error','message'=>'ID tidak valid.']); exit; }
|
|
|
|
try {
|
|
$pdo->prepare("DELETE FROM points WHERE id=?")->execute([$id]);
|
|
echo json_encode(['status'=>'success']);
|
|
} catch (PDOException $e) {
|
|
echo json_encode(['status'=>'error','message'=>$e->getMessage()]);
|
|
}
|
|
?>
|