Jump to content

Recommended Posts

Below I have my Blog Class that controls everything to do with my blog.

 

I want to be able to parse the `home_body` using the NBBC Code Parser.

 

However, when I try to run the Parse method on my `home_body` row, I get this error!

 

Call to a member function Parse() on a non-object

 

Can anyone help me and tell me what I am doing wrong?

 

<?php
include("nbbc.php");
$bbcode = new BBCode; 

class Blog {

    private $dbLink;
var $title, $home_body, $main_body, $blog_created, $posted_by, $blog_thumb;


    function __construct() {
	$this->dbLink = mysql_connect('localhost', 'root', '');
	mysql_select_db('test');		
    }

function Retrieve_Blogs() {		
	$this->dbLink = mysql_query("SELECT * FROM `blog` ORDER BY `blog_created` DESC");
	while($row = mysql_fetch_array($this->dbLink)) {	
		echo $bbcode->Parse($row['home_body']);
	}
}

function Show_Blog($blog_title) {
	$this->dbLink = mysql_query("SELECT * FROM `blog` WHERE `blog_title` = '$blog_title'");		
	while($this->rows = mysql_fetch_array($this->dbLink)) {	
		print $this->rows['blog_title'];		
	}
}


}
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.