diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-02 14:45:41 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-02 14:45:41 +0100 |
commit | 4be5de1d11eefd9f0b7cf0589a2942f067cefe35 (patch) | |
tree | 6b360e221710377c2de0f3360e6c11a9ba1e9d6b /system/database/drivers/mssql/mssql_driver.php | |
parent | bcb3bbb97c8c046f80009a2bd8dffb96795ed239 (diff) |
Replaced DB methods _error_message() and _error_number() with error() (issue #1097)
Diffstat (limited to 'system/database/drivers/mssql/mssql_driver.php')
-rw-r--r-- | system/database/drivers/mssql/mssql_driver.php | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 2a4f2b575..188c91f9b 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -438,28 +438,18 @@ class CI_DB_mssql_driver extends CI_DB { // -------------------------------------------------------------------- /** - * The error message string + * Error * - * @access private - * @return string - */ - function _error_message() - { - return mssql_get_last_message(); - } - - // -------------------------------------------------------------------- - - /** - * The error message number + * Returns an array containing code and message of the last + * database error that has occured. * - * @access private - * @return integer + * @return array */ - function _error_number() + public function error() { - // Are error numbers supported? - return ''; + $query = $this->query('SELECT @@ERROR AS code'); + $query = $query->row(); + return array('code' => $query->code, 'message' => mssql_get_last_message()); } // -------------------------------------------------------------------- |