PEAR DB, Smarty, dsn pgsql, mysql problem.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

PEAR DB, Smarty, dsn pgsql, mysql problem.

Post 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()
:?
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post 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)
Post Reply