<?php
require_once "config.php";

$match_type = trim($_POST['match_type'] ?? '');

if (empty($match_type)) {

    echo "match_type is empty";
    exit;

}

$sql = "DELETE FROM freefire 
        WHERE match_type = ? 
        AND match_result = 'YES'";

$stmt = $conn->prepare($sql);
$stmt->bind_param("s", $match_type);

if ($stmt->execute()) {

    echo "Delete Successfully";

} else {

    echo "Delete Failed";

}

$stmt->close();
$conn->close();
?>