|
From: Benjamin C. <bc...@us...> - 2002-04-14 23:47:40
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv18194
Modified Files:
include.php
Log Message:
Die with the error message when failing to connect to the database
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -r1.113 -r1.114
--- include.php 11 Apr 2002 20:16:11 -0000 1.113
+++ include.php 14 Apr 2002 23:47:37 -0000 1.114
@@ -46,6 +46,9 @@
'password' => DB_PASSWORD
);
$db = DB::Connect($dsn);
+if (DB::isError($db)) {
+ die($db->message);
+}
$db->setOption('optimize', 'portability');
$db->setFetchMode(DB_FETCHMODE_ASSOC);
$db->setErrorHandling(PEAR_ERROR_CALLBACK, "handle_db_error");
@@ -105,6 +108,7 @@
error_reporting(E_ALL ^ E_NOTICE); // Clobber Smarty warnings
return Smarty::fetch($_smarty_tpl_file, $_smarty_cache_id, $_smarty_compile_id, $_smarty_display);
}
+
}
$t = new extSmarty;
|