mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
fixed Database error handling
This commit is contained in:
@@ -28,10 +28,11 @@ class DB
|
||||
$options = &self::$optionsCache[$idx];
|
||||
$interface = DbSimple_Generic::connect(self::createConnectSyntax($options));
|
||||
|
||||
if (!$interface)
|
||||
$interface->setErrorHandler(array('DB', 'errorHandler'));
|
||||
|
||||
if ($interface->error)
|
||||
die('Failed to connect to database.');
|
||||
|
||||
$interface->setErrorHandler(array('DB', 'errorHandler'));
|
||||
$interface->query('SET NAMES ?', 'utf8');
|
||||
if ($options['prefix'])
|
||||
$interface->setIdentPrefix($options['prefix']);
|
||||
|
||||
Reference in New Issue
Block a user