diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-04 21:33:13 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-04 21:33:13 -0500 |
commit | 5120f36a258ffcbffd5c10e9a1056d64ea794a16 (patch) | |
tree | 120123e31ff645fff4f55ec4c1a50fd4070669d6 /phpBB | |
parent | 597dea1e047b94f0a862f7f6e650771ffc780141 (diff) | |
download | forums-5120f36a258ffcbffd5c10e9a1056d64ea794a16.tar forums-5120f36a258ffcbffd5c10e9a1056d64ea794a16.tar.gz forums-5120f36a258ffcbffd5c10e9a1056d64ea794a16.tar.bz2 forums-5120f36a258ffcbffd5c10e9a1056d64ea794a16.tar.xz forums-5120f36a258ffcbffd5c10e9a1056d64ea794a16.zip |
[ticket/10205] Reduce nesting in mysql drivers.
PHPBB3-10205
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/db/mysql.php | 25 | ||||
-rw-r--r-- | phpBB/includes/db/mysqli.php | 25 |
2 files changed, 22 insertions, 28 deletions
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index e638531f51..252cb20bd4 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -444,22 +444,19 @@ class dbal_mysql extends dbal 'code' => @mysql_errno($this->db_connect_id), ); } + else if (function_exists('mysql_error')) + { + $error = array( + 'message' => @mysql_error(), + 'code' => @mysql_errno(), + ); + } else { - if (function_exists('mysql_error')) - { - $error = array( - 'message' => @mysql_error(), - 'code' => @mysql_errno(), - ); - } - else - { - $error = array( - 'message' => $this->connect_error, - 'code' => '', - ); - } + $error = array( + 'message' => $this->connect_error, + 'code' => '', + ); } return $error; diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index b2a43d35f9..69f1d26a40 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -430,22 +430,19 @@ class dbal_mysqli extends dbal 'code' => @mysqli_errno($this->db_connect_id) ); } + else if (function_exists('mysqli_connect_error')) + { + $error = array( + 'message' => @mysqli_connect_error(), + 'code' => @mysqli_connect_errno(), + ); + } else { - if (function_exists('mysqli_connect_error')) - { - $error = array( - 'message' => @mysqli_connect_error(), - 'code' => @mysqli_connect_errno(), - ); - } - else - { - $error = array( - 'message' => $this->connect_error, - 'code' => '', - ); - } + $error = array( + 'message' => $this->connect_error, + 'code' => '', + ); } return $error; |