Do not simply exit on DB connection error

This commit is contained in:
Kijin Sung 2016-03-20 00:32:31 +09:00
parent e87f91c6d8
commit 5b5c785b19

View file

@ -67,7 +67,8 @@ class DBMysql extends DB
$result = @mysql_connect($connection['host'], $connection['user'], $connection['pass']); $result = @mysql_connect($connection['host'], $connection['user'], $connection['pass']);
if(!$result) if(!$result)
{ {
exit('Unable to connect to DB.'); $this->setError(-1, 'Unable to connect to DB.');
return;
} }
if(mysql_error()) if(mysql_error())
@ -164,7 +165,8 @@ class DBMysql extends DB
{ {
if(!$connection) if(!$connection)
{ {
exit('Rhymix cannot handle DB connection.'); $this->setError(-1, 'Unable to connect to DB.');
return false;
} }
// Run the query statement // Run the query statement
$result = @mysql_query($query, $connection); $result = @mysql_query($query, $connection);