20 lines
450 B
PHP
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;
|
|
?>
|