From 4be5de1d11eefd9f0b7cf0589a2942f067cefe35 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 2 Mar 2012 15:45:41 +0200 Subject: Replaced DB methods _error_message() and _error_number() with error() (issue #1097) --- system/database/drivers/mysqli/mysqli_driver.php | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_driver.php') diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index dbba12e15..031371345 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -418,25 +418,16 @@ class CI_DB_mysqli_driver extends CI_DB { // -------------------------------------------------------------------- /** - * The error message string + * Error * - * @return string - */ - protected function _error_message() - { - return mysqli_error($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * The error message number + * Returns an array containing code and message of the last + * database error that has occured. * - * @return int + * @return array */ - protected function _error_number() + public function error() { - return mysqli_errno($this->conn_id); + return array('code' => mysqli_errno($this->conn_id), 'message' => mysqli_error($this->conn_id)); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b