diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-09 13:29:09 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-09 13:29:09 +0100 |
commit | a3b83d6562ca3f9ed0b429a2a6f3272b9f8bd72e (patch) | |
tree | aa9d105f7c94d513b27f5931b121641409c0b91a /system/database/drivers/mssql/mssql_driver.php | |
parent | b6c7ec262523dc1ddb618c6aaa11c20fe833ba0f (diff) | |
parent | c016a1102e2a77e0c27b9656c19a0460df24dfb6 (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/drivers/mssql/mssql_driver.php')
-rw-r--r-- | system/database/drivers/mssql/mssql_driver.php | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 2a4f2b575..39b84f9c6 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -339,12 +339,11 @@ class CI_DB_mssql_driver extends CI_DB { /** * Version number query string * - * @access public - * @return string + * @return string */ - function _version() + protected function _version() { - return "SELECT @@VERSION AS ver"; + return 'SELECT @@VERSION AS ver'; } // -------------------------------------------------------------------- @@ -366,8 +365,7 @@ class CI_DB_mssql_driver extends CI_DB { return 0; } - $query = $this->query($this->_count_string . $this->_protect_identifiers('numrows') . " FROM " . $this->_protect_identifiers($table, TRUE, NULL, FALSE)); - + $query = $this->query($this->_count_string.$this->protect_identifiers('numrows').' FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE)); if ($query->num_rows() == 0) { return 0; @@ -438,28 +436,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()); } // -------------------------------------------------------------------- |