<?php
include 'includes/connect.php';

if(isset($_POST['id'])){
    $id = intval($_POST['id']);
    $query = "DELETE FROM distributor WHERE id=$id";
    if(mysqli_query($conn, $query)){
        echo "Distributor deleted successfully";
    } else {
        echo "Error deleting distributor";
    }
} else {
    echo "Invalid request";
}
?>