include("inc/app-top.php"); ?> include("inc/db.php"); ?> include("inc/functions.php"); ?> if(isset($_GET['i'])) { $blog_id = $_GET['i']; } $get_blog_content= $conn->prepare("SELECT `category_ids`,`name`,`description`,`image`,`date` FROM `blog` WHERE `id` = :blog_id "); $get_blog_content->bindParam(':blog_id',$blog_id); $get_blog_title = $conn->prepare("SELECT `name`,`id` FROM `blog_categories` WHERE `id` = :cat_id "); $get_blog_title->bindParam(':cat_id',$cat_id); //////get the blog contents $get_blog_content->execute(); while($row = $get_blog_content->fetch(PDO::FETCH_ASSOC)) { $blog_title = htmlentities($row['name']); $img = htmlentities($row['image']); $date = $row['date']; $date = str_replace("-","/","$date"); $nicedate = nice_date($date,true,false,false,false); $cat_ids = $row['category_ids']; $description = $row['description']; $description = str_replace('"/assets/cube3/media/','"https://app.supplyengine.co.uk/assets/cube3/media/',$description); ////get the category for this blog article $get_blog_title->execute(); $row = $get_blog_title->fetch(PDO::FETCH_ASSOC); $blog_category = $row['name']; } //Get category name $cat_ids_arr = explode(",",$cat_ids); $cat_id = $cat_ids_arr[0]; $get_cat_title = $conn->prepare("SELECT `name`,`id` FROM `blog_categories` WHERE `id` = :cat_id "); $get_cat_title->bindParam(':cat_id',$cat_id); $get_cat_title->execute(); $row2 = $get_cat_title->fetch(PDO::FETCH_ASSOC); $cat_name = $row2['name']; $cat_url = "/blog-list/".nice_url($cat_name)."/".$cat_id; $cat_str = "$cat_name"; ?> $current = "news";?> $page_title = "Blog: $blog_title ";?>