diff options
Diffstat (limited to 'include/dblayer/functions_pdo-sqlite.inc.php')
-rw-r--r-- | include/dblayer/functions_pdo-sqlite.inc.php | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/include/dblayer/functions_pdo-sqlite.inc.php b/include/dblayer/functions_pdo-sqlite.inc.php index aba554341..33a864980 100644 --- a/include/dblayer/functions_pdo-sqlite.inc.php +++ b/include/dblayer/functions_pdo-sqlite.inc.php @@ -33,16 +33,16 @@ define('DB_RANDOM_FUNCTION', 'RANDOM'); * */ -function pwg_db_connect($host, $user, $password, $database, $die=true) +function pwg_db_connect($host, $user, $password, $database) { global $conf; $db_file = sprintf('sqlite:%s/%s.db', $conf['local_data_dir'], $database); - try { - $link = new PDO($db_file); - } catch (Exception $e) { - my_error('sqlite::open', $die); + $link = new PDO($db_file); + if (!$link) + { + throw new Exception('Connection to server succeed, but it was impossible to connect to database'); } $link->sqliteCreateFunction('now', 'pwg_now', 0); @@ -56,11 +56,6 @@ function pwg_db_connect($host, $user, $password, $database, $die=true) return $link; } -function pwg_select_db($database=null, $link=null, $die=null) -{ - return true; -} - function pwg_db_check_charset() { return true; |