mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/17232] Improve SQL error messages handling
PHP 7 changes how most errors are reported by PHP. Instead of reporting errors through the traditional error reporting mechanism used by PHP 5, most errors are now reported by throwing Error exceptions. Use it to display meaningful SQL error messages instead of PHP fatal errors for SQL errors. PHPBB3-17232
This commit is contained in:
@@ -166,7 +166,16 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
|
||||
|
||||
if ($this->query_result === false)
|
||||
{
|
||||
if (($this->query_result = @odbc_exec($this->db_connect_id, $query)) === false)
|
||||
try
|
||||
{
|
||||
$this->query_result = @odbc_exec($this->db_connect_id, $query);
|
||||
}
|
||||
catch (\Error $e)
|
||||
{
|
||||
// Do nothing as SQL driver will report the error
|
||||
}
|
||||
|
||||
if ($this->query_result === false)
|
||||
{
|
||||
$this->sql_error($query);
|
||||
}
|
||||
|
Reference in New Issue
Block a user