<?php
include '../inc/db.php';

header('Content-Type: text/plain');

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

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

$delete = mysqli_query($conn, "
DELETE FROM product_materials
WHERE id = '$id'
");

if ($delete) {
    echo 1;
} else {
    echo 0;
}