mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/10205] Rewrite _sql_error implementations to have a single return.
PHPBB3-10205
This commit is contained in:
@@ -423,28 +423,32 @@ class dbal_mysqli extends dbal
|
||||
*/
|
||||
function _sql_error()
|
||||
{
|
||||
if (!$this->db_connect_id)
|
||||
if ($this->db_connect_id)
|
||||
{
|
||||
$error = array(
|
||||
'message' => @mysqli_error($this->db_connect_id),
|
||||
'code' => @mysqli_errno($this->db_connect_id)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (function_exists('mysqli_connect_error'))
|
||||
{
|
||||
return array(
|
||||
$error = array(
|
||||
'message' => @mysqli_connect_error(),
|
||||
'code' => @mysqli_connect_errno(),
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return array(
|
||||
$error = array(
|
||||
'message' => $this->connect_error,
|
||||
'code' => '',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'message' => @mysqli_error($this->db_connect_id),
|
||||
'code' => @mysqli_errno($this->db_connect_id)
|
||||
);
|
||||
return $error;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user