Page 1 of 1

PEAR DB, Smarty, dsn pgsql, mysql problem.

Posted: Tue Nov 02, 2004 1:43 am
by harsha
Help me in figuring out the problem mentioned below

file name: smartdb.php

Code: Select all

<?
class smartDB extends DB
{
	var $ooResult;
	var $ooRowz;
	var $ooContainer;

	function smartDB()
	{
		$this->ooResult = NULL
		$this->ooRowz = NULL
		$this->ooContainer = array();
	}

	function getMatrix( $dbQuery)
	{
		global $dbHndl;
		$this->ooResult = $dbHndl->query($dbQuery);
		while($this->ooRows = $this->ooResult->fetchRow())
		{
			array_push($this->oocontainer, $this->Rows);
		}
		return $this->ooContainer;
	}
	
	function setMatrix($matrixName, $Matrix)
	{
		global $smartyObj;
		$smartyObj->assign($matrixname, $Matrix);
	}
}
?>
Filename: ModNews.php

I have initialised the object of smartDB in this file

Filename: index.php

I have included
DB.php
smartDB.php
config.php
etc in this file.

the problem is when I use mysql there is no error
and when I use pgsql there is an error saying undefined function fetchRow()
:?

Posted: Wed Nov 03, 2004 8:08 pm
by markl999
I've no idea what smartDB is or what it's purpose in life is, but if it's extending PEAR DB then you should be able to use it's debugging to find out what's wrong.
http://pear.php.net/manual/en/package.d ... -error.php

If you can avoid using that class then do so as it's pretty pointless and badly written. A db wrapper around a db wrapper using a template engine that wraps a template engine ;)
(sorry, couldn't resist)