Hey Guys,
I am playing around with DB abstraction layers and PEAR. However, I am having some trouble getting the following code to work correctly.
function __construct($dsn = null) {
global $conn;
global $cfg;
//If nothing was passed in, use the value from $cfg
if($dsn == null) {
$dsn = $cfg['db']['dsn'];
}
//Open a connection using the info in $dsn
$this->conn =& DB::connect($dsn, TRUE);
if(DB::isError($this->conn)) {
//We're not connected. Throw an exception
throw new Exception($this->conn->getMessage(), $this->conn->getCode());
}
//Always fetch data as an associative array
$this->conn->setFetchMode(DB_FETCHMODE_ASSOC);
}
The code never runs past the DB::connect line of code for some reason. I cannot get any error information because no exception is thrown. I have als tried to use die() but get the same result. The dsn is correct according to PEAR documentation.
If this makes any difference, I am running IIS 6, PHP5/MySQL5.
Any help would be greatly appreciated!