<?php
include '../inc/db.php';
header('Content-Type: application/json');

$id = (int)($_POST['id'] ?? 0);

if(!$id){
    echo 0;
    exit;
}

$del = mysqli_query($conn,"DELETE FROM subcategories WHERE id=$id");

echo $del ? 1 : 0;