To mnie sie dzisiaj ciezko myśli

bo nie chce to działać
index.php
<?php
$news = new News;
require 'smarty/smarty.class.php';
$smarty = new Smarty; //core smarty object
switch ($_GET['action']) {
case 'view' :
default : $news->viewNews();
}
?>
w functions.php
<?php
class News {
// database object
var $db;
//konstruktor
function News() {
$this -> db = new DbConnect("localhost","root","","catalog",$error_reporting=true,$persistent=false);
}
function viewNews() {
$this->db->query("SELECT * FROM logbook") or
die($db->error());
}
}
?>
za każdym razem Fatal error: Call to a member function on a non-object

ok już wiem o co biega

może komuś to pomoże:
<?php
require './smarty/smarty.class.php';
require './includes/classes/DBconnect.class.php';
class News_Smarty extends Smarty {
function News_Smarty() {
$this->template_dir = 'templates/tmpl1';
$this->compile_dir = 'templates_c';
$this->config_dir = 'configs';
$this->cache_dir = 'cache';
}
}
class News {
var $tpl;
var $sql;
var $db;
//constructor
function News() {
$this -> tpl =& new News_Smarty;
$this -> sql =& new DbConnect("localhost","root","","catalog",$error_reporting=true,$persistent=false);
$this -> sql
-> open
() or
die($this -> sql
->error()); }
function viewNews() {
$db = $this -> sql;
$db -> query
("SELECT * FROM product") or
die($db->error());
$il=$db->numrows();
for($i = 0; $i < $il; $i++) {
$row=$db->fetcharray();
$data[] = $row;
}
$this -> tpl -> assign('view', '1');
$this -> tpl -> assign('data', $data);
$this -> tpl -> display('index.tpl');
}
}
?>