MDB2 Error

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Someone tell me what is wrong in the following code -




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

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);



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. :?

Site Timeline