11-03-2016, 01:37 AM
I see a few things. I don't do a lot of do while loops, but the first line should be
$query = $db->query("SELECT * FROM pages WHERE id = ?",array($parent_page_id));
The problem with your do while loop is that you have an object instead of an array.
Just for the heck of it, after the results, do
dump($results);
and you can see how that data is formatted.
I know I screwed up some of your concatenation at the end and you'll have to fix that, but I'm guessing you're going to want something like
$query = $db->query("SELECT * FROM pages WHERE id = ?",array($parent_page_id));
$results = $query->results();
foreach($result as $result){
$parent_page_path = $result->page;
$parent_page_title = $result->page_title;
$breadcrumb .= ' ยป <i class="fa fa-home"></i> ' . $parent_page_title;
$new_parent_page_id = $result->parent_page_id;
}
$query = $db->query("SELECT * FROM pages WHERE id = ?",array($parent_page_id));
The problem with your do while loop is that you have an object instead of an array.
Just for the heck of it, after the results, do
dump($results);
and you can see how that data is formatted.
I know I screwed up some of your concatenation at the end and you'll have to fix that, but I'm guessing you're going to want something like
$query = $db->query("SELECT * FROM pages WHERE id = ?",array($parent_page_id));
$results = $query->results();
foreach($result as $result){
$parent_page_path = $result->page;
$parent_page_title = $result->page_title;
$breadcrumb .= ' ยป <i class="fa fa-home"></i> ' . $parent_page_title;
$new_parent_page_id = $result->parent_page_id;
}