<?php
// Connect to the database
$host = 'localhost';
$user = 'your_db_user';
$password = 'your_db_password';
$dbname = 'your_db_name';

$mysqli = $conn;

// Check connection
if ($mysqli->connect_error) {
    die("Connection failed: " . $mysqli->connect_error);
}

// Get the product ID from the POST data
$product_id = $_POST['product_id'];

// Delete the product from the database
$sql = "DELETE FROM products WHERE product_id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param('i', $product_id);
$stmt->execute();
$stmt->close();

// Close the database connection
$mysqli->close();
?>
