Manage Posts
Create New PostPost deleted successfully.
Post saved successfully.
No posts found.
Create your first post| Title | Created At | Actions |
|---|---|---|
| Edit |
prepare("DELETE FROM posts WHERE id = ?"); $stmt->execute([$_POST['delete_id']]); header("Location: admin.php?deleted=true"); exit; } catch (PDOException $e) { error_log("DB Error: " . $e->getMessage()); // In a real app, you'd have a more robust error handling system die("Error deleting post. Check logs for details."); } } $posts = []; try { $pdo = db(); $stmt = $pdo->query("SELECT id, title, created_at FROM posts ORDER BY created_at DESC"); $posts = $stmt->fetchAll(); } catch (PDOException $e) { error_log("DB Error: " . $e->getMessage()); } ?>
No posts found.
Create your first post| Title | Created At | Actions |
|---|---|---|
| Edit |