Database: patch error handling to account for exceptions thrown by mysqli_query
This commit is contained in:
parent
b64f87a49d
commit
d6f39a3410
@ -306,9 +306,11 @@ class Database
|
||||
if (defined("DB_LOG_QUERIES") && DB_LOG_QUERIES)
|
||||
$this->logged_queries[] = $db_string;
|
||||
|
||||
$return = @mysqli_query($this->connection, $db_string, empty($this->unbuffered) ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT);
|
||||
|
||||
if (!$return)
|
||||
try
|
||||
{
|
||||
$return = @mysqli_query($this->connection, $db_string, empty($this->unbuffered) ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
$clean_sql = implode("\n", array_map('trim', explode("\n", $db_string)));
|
||||
trigger_error($this->error() . '<br>' . $clean_sql, E_USER_ERROR);
|
||||
|
Loading…
Reference in New Issue
Block a user