summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mssql/mssql_driver.php
diff options
context:
space:
mode:
authorJamie Rumbelow <jamie@jamierumbelow.net>2012-03-06 22:27:46 +0100
committerJamie Rumbelow <jamie@jamierumbelow.net>2012-03-06 22:27:46 +0100
commit3b1355c595127280d6d84d8b617a91fbeda319f5 (patch)
tree61e9d7c334e350846ffc3b528fbcbe85b036e1e9 /system/database/drivers/mssql/mssql_driver.php
parent576b47e9947d4f5bc25a3f72e3978a3d7f9ca1de (diff)
parent738f53448fecd1a27c7f89965fbfc47b3bafdb9b (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Conflicts: system/database/DB_driver.php system/database/DB_query_builder.php
Diffstat (limited to 'system/database/drivers/mssql/mssql_driver.php')
-rw-r--r--system/database/drivers/mssql/mssql_driver.php52
1 files changed, 12 insertions, 40 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index 52d5db653..563210c90 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -138,22 +138,6 @@ class CI_DB_mssql_driver extends CI_DB {
// --------------------------------------------------------------------
/**
- * Set client character set
- *
- * @access public
- * @param string
- * @param string
- * @return resource
- */
- function db_set_charset($charset, $collation)
- {
- // @todo - add support if needed
- return TRUE;
- }
-
- // --------------------------------------------------------------------
-
- /**
* Execute the query
*
* @access private called by the base class
@@ -355,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';
}
// --------------------------------------------------------------------
@@ -382,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;
@@ -454,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());
}
// --------------------------------------------------------------------