summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mssql/mssql_driver.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/mssql/mssql_driver.php')
-rw-r--r--system/database/drivers/mssql/mssql_driver.php38
1 files changed, 13 insertions, 25 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index 2a4f2b575..b6b64cc44 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -2,7 +2,7 @@
/**
* CodeIgniter
*
- * An open source application development framework for PHP 5.1.6 or newer
+ * An open source application development framework for PHP 5.2.4 or newer
*
* NOTICE OF LICENSE
*
@@ -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());
}
// --------------------------------------------------------------------