[pLog-svn] r3508 - plog/trunk/class/database
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Thu Jun 1 22:47:21 GMT 2006
Author: oscar
Date: 2006-06-01 22:47:21 +0000 (Thu, 01 Jun 2006)
New Revision: 3508
Modified:
plog/trunk/class/database/db.class.php
Log:
added some debug information when not able to connect to the db
Modified: plog/trunk/class/database/db.class.php
===================================================================
--- plog/trunk/class/database/db.class.php 2006-06-01 21:35:26 UTC (rev 3507)
+++ plog/trunk/class/database/db.class.php 2006-06-01 22:47:21 UTC (rev 3508)
@@ -43,13 +43,18 @@
$dbpersistent = $fileConfig->getValue( "db_persistent" );
if($dbpersistent == true) {
if( !$db->PConnect( $host, $username, $password, $dbname, $dbcharset )) {
- die( "Fatal error: could not connect to the database!" );
+ $message = "Fatal error: could not connect to the database!".
+ " Error: ".$db->ErrorMsg();
+ throw( new Exception( $message ));
+ die();
}
}
else {
if( !$db->Connect( $host, $username, $password, $dbname, $dbcharset )) {
- throw( new Exception( "Fatal error: could not connect to the database!" ));
- die();
+ $message = "Fatal error: could not connect to the database!".
+ " Error: ".$db->ErrorMsg();
+ throw( new Exception( $message ));
+ die();
}
}
// just in case, forcing to use indexing by field name instead of
More information about the pLog-svn
mailing list