File "delete-withdrawals.php"

Full Path: /home/quiczmwg/lightspringdigitals.com/__MACOSX/admin/delete-withdrawals.php
File size: 565 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
include 'head.php';

session_start();

if (isset($_GET['delete'])) {
    $delete_id = $_GET['delete'];
    
    // Use prepared statement to delete record
    $delete_query = $conn->prepare("DELETE FROM withdrawals WHERE id = ?");
    $delete_query->execute([$delete_id]);

    if ($delete_query) {
        header('location: confirmed_withdrawal.php');
        $_SESSION['message'] = 'Withdrawal has been deleted';
    } else {
        header('location: confirmed_withdrawal.php');
        $_SESSION['message'] = 'Withdrawal could not be deleted';
    }
}
?>