<?php
require __DIR__ . "/db.php";

$division = $_POST['division'] ?? '';
$name     = $_POST['name'] ?? '';

$division = trim($division);
$name     = trim($name);

if ($division === '' || $name === '') {
    echo "0";
    exit;
}

$stmt = $conn->prepare("DELETE FROM division_names WHERE division=? AND name=? LIMIT 1");
$stmt->bind_param("ss", $division, $name);

echo ($stmt->execute() && $stmt->affected_rows > 0) ? "1" : "0";
$stmt->close();