prepare($sql); $query->bindParam(':post_id', $postId, PDO::PARAM_INT); $query->execute(); $post = $query->fetch(PDO::FETCH_OBJ); if ($post) { $title = htmlspecialchars($post->title); $description = htmlspecialchars(substr(strip_tags($post->description), 0, 150)); // Limit description to 150 characters $image = "https://m-fireworld.com/admin/uploads/photos/" . htmlspecialchars($post->filename); $url = "https://m-fireworld.com/our-news-updates/index.php?post_id=" . $post->ID; // Use "ID" here } else { // Fallback for invalid post_id $title = "Our News Updates"; $description = "Stay updated with our latest news and blogs."; $image = "https://m-fireworld.com/admin/uploads/photos/" . htmlspecialchars($post->filename); $url = "https://m-fireworld.com/our-news-updates/"; } } else { // Fallback for when no post_id is provided $title = "Our News Updates"; $description = "Stay updated with our latest news and blogs."; $image = "https://m-fireworld.com/admin/uploads/photos/" . htmlspecialchars($post->filename); $url = "https://m-fireworld.com/our-news-updates/"; } ?>