prepare('DELETE FROM invoices WHERE id = ?'); $stmt->execute([$invoice_id]); } catch (PDOException $e) { // Optional: Log the error or show a generic error message // For simplicity, we redirect without an error message } } header('Location: invoices.php'); exit; ?>