<?php
// Database connection (replace with your own details)
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "your_database";

$conn = new mysqli($servername, $username, $password, $dbname);

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

// Check if an ID is provided in the URL
if (isset($_GET['id'])) {
    $marketing_id = $_GET['id'];
    
    // Delete marketing user from the database
    $delete_sql = "DELETE FROM marketing_users WHERE id = $marketing_id";
    
    if ($conn->query($delete_sql) === TRUE) {
        echo "Marketing user deleted successfully!";
        header("Location: marketing_list.php"); // Redirect back to the marketing list
    } else {
        echo "Error deleting marketing user: " . $conn->error;
    }
}

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