diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-04 21:32:02 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-04 21:32:02 -0500 |
commit | 597dea1e047b94f0a862f7f6e650771ffc780141 (patch) | |
tree | e278a3d4bef7b726f40c2721666fb77b1587a1b2 /phpBB/includes/db/mysql.php | |
parent | 89c9c9d4b0daa7308fd015e8a6fca6386a8b8016 (diff) | |
download | forums-597dea1e047b94f0a862f7f6e650771ffc780141.tar forums-597dea1e047b94f0a862f7f6e650771ffc780141.tar.gz forums-597dea1e047b94f0a862f7f6e650771ffc780141.tar.bz2 forums-597dea1e047b94f0a862f7f6e650771ffc780141.tar.xz forums-597dea1e047b94f0a862f7f6e650771ffc780141.zip |
[ticket/10205] Rewrite _sql_error implementations to have a single return.
PHPBB3-10205
Diffstat (limited to 'phpBB/includes/db/mysql.php')
-rw-r--r-- | phpBB/includes/db/mysql.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 0125be0917..e638531f51 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -437,28 +437,32 @@ class dbal_mysql extends dbal */ function _sql_error() { - if (!$this->db_connect_id) + if ($this->db_connect_id) + { + $error = array( + 'message' => @mysql_error($this->db_connect_id), + 'code' => @mysql_errno($this->db_connect_id), + ); + } + else { if (function_exists('mysql_error')) { - return array( + $error = array( 'message' => @mysql_error(), 'code' => @mysql_errno(), ); } else { - return array( + $error = array( 'message' => $this->connect_error, 'code' => '', ); } } - return array( - 'message' => @mysql_error($this->db_connect_id), - 'code' => @mysql_errno($this->db_connect_id), - ); + return $error; } /** |