MDB2 Error

MDB2 Error

am 07.04.2008 04:41:07 von Nilesh India

Someone tell me what is wrong in the following code -


require_once("MDB2.php");

require_once("config.php");

if(!isset($cfg->dbinfo)): die("Error: DSN not set\n\n"); exit(1);
endif;

class dbal extends MDB2

{

public $con;

private $info;

public function chkerr($element) { if(PEAR::isError($element)):
die($element->getMessage()); endif; }

public function dbal()

{

$this->info = $cfg->dbinfo;

$this->con = & $this->connect($this->info);

$this->chkerr($this->con);

}

const live = 1;

function __destruct() { $this->con->disconnect(); unset($this->con);
unset($this->info); unset($cfg->dbinfo); }

}

$dbal = new dbal();


?>

When I run it I get -

MDB2 Error: not found
Fatal error: Call to undefined method MDB2_Error::disconnect() in /
home/Nilesh/website/mysql.php on line 33

----

What is the problem here ?

well one more thing to tell, when I directly connect to it without a
dbal class, it works. :?