I wonder if anyone can see what i am doing wrong here... I have created a table called blog_posts and just want to echo the posts onto my index page. I have created the cms application from Bens tutorials, and essentially i am trying to copy what he did with his code to create two new functions (display_blog and load_blog) All i want to do is use this function on my index page... But cannot see where i am going wrong....
Heres my code: (m_cms.php)
function load_blog()
{
// get contents from database
if ($stmt = $this->FS->Database->prepare("SELECT * FROM blog_posts ORDER BY id"))
{
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0)
{
$stmt->bind_result($blog_posts);
$stmt->fetch();
$stmt->close();
return $blog_posts;
}
else
{
$stmt->close();
return FALSE;
}
}
}
function display_blog()
{
// get content
$blog_posts = $this->load_blog();
// check login status
if ($this->FS->Auth->checkLoginStatus())
{
echo'You are logged in';
}
else
{
echo $blog_posts;
}
}
Code on my index page :
<?php $FS->Cms->display_blog();?>
If anyone can give me some guidance I would appreciate it alot
Kind Regards CLU

Help












