<?php
require 'config.php';

$id = $_GET['id'] ?? null;
if (!$id) {
    exit('No article ID provided');
}

$stmt = $dbh->prepare("DELETE FROM articles WHERE id = ?");
$stmt->execute([$id]);

header('Location: articles_list.php');
exit;
