<?php
session_start();
require_once '../db.php'; // include PDO database connection

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

if ($id > 0) {
    $stmt = $pdo->prepare("DELETE FROM blogs WHERE id = ?");
    $stmt->execute([$id]);
}

header("Location: blog_list.php");
exit;
?>
