35251-vm/delete_customer.php
2025-10-26 16:53:16 +00:00

20 lines
450 B
PHP

<?php
require_once 'db/config.php';
$customer_id = $_GET['id'] ?? null;
if ($customer_id) {
try {
$pdo = db();
$stmt = $pdo->prepare('DELETE FROM customers WHERE id = ?');
$stmt->execute([$customer_id]);
} catch (PDOException $e) {
// Optional: Log the error or show a generic error message
// For simplicity, we redirect without an error message
}
}
header('Location: customers.php');
exit;
?>