<?php
require_once "../config/db.php";

$id = (int) ($_GET['id'] ?? 0);

$stmt = $conn->prepare("DELETE FROM expenses WHERE id=?");
$stmt->bind_param("i", $id);
$stmt->execute();

header("Location: ../pages/expenses.php");
exit;
