'index']]; require_once($rootPath . '/components/banner.php'); $result = $conn->prepare(" SELECT b.blog_id, b.title, b.description, b.status, b.date, b.image, CONCAT(u.first_name, ' ', u.last_name) AS author_name, u.email AS author_email, u.profile_pic FROM blogs b JOIN users u ON b.author = u.user_id WHERE b.status = 'published' ORDER BY b.date DESC "); $result->execute(); $posts = $result->get_result(); ?>

Manage Blog Posts

×
+ New Post fetch_assoc()): // Determine cover image - use provided image or fallback placeholder $coverImage = $post["image"] ? $post["image"] : 'assets/images/placeholder.jpg'; // Output the HTML structure with dynamic data echo '
' . htmlspecialchars($post[
Author
' . strtoupper($post["status"]) . '
' . $post["title"] . '
' . $post["author_name"] . '

' . $post["description"] . '

'; endwhile; ?>