diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-05-24 22:27:46 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-05-24 22:27:46 +0200 |
commit | 846acc7926ccb991d39135353d5047e7de5bcb60 (patch) | |
tree | 2fb00af13ee65d32e16c87d79b4b4eb0b9a9cb22 /system | |
parent | 91900dd09b83ab61c9475c10c94a1fe01b684080 (diff) |
Fix issue #319
Diffstat (limited to 'system')
-rw-r--r-- | system/database/drivers/sqlsrv/sqlsrv_driver.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index 3e9fa7b1a..5a24f5532 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -132,11 +132,9 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ protected function _execute($sql) { - return sqlsrv_query($this->conn_id, - $sql, - NULL, - array('Scrollable'=> SQLSRV_CURSOR_STATIC, 'SendStreamParamsAtExec' => TRUE) - ); + return (is_write_type($sql) && stripos($sql, 'INSERT') === FALSE) + ? sqlsrv_query($this->conn_id, $sql) + : sqlsrv_query($this->conn_id, $sql, NULL, array('Scrollable' => SQLSRV_CURSOR_STATIC)); } // -------------------------------------------------------------------- @@ -237,7 +235,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ public function affected_rows() { - return @sqlrv_rows_affected($this->conn_id); + return sqlrv_rows_affected($this->result_id); } // -------------------------------------------------------------------- |