Jump to content

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


gaza165

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'];		
	}
}


}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.