diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-09 13:21:54 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-09 13:21:54 +0100 |
commit | 9771548893f4580f9fe6be91fae00487782bd9be (patch) | |
tree | d6df3ed6dcfe3c1a705fdd89a24f4c91e2fe2dfd /system/database/drivers/odbc | |
parent | f24d30aee7ca0e007ad428a920d0a52cddb05282 (diff) | |
parent | c016a1102e2a77e0c27b9656c19a0460df24dfb6 (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/drivers/odbc')
-rw-r--r-- | system/database/drivers/odbc/odbc_driver.php | 3 | ||||
-rw-r--r-- | system/database/drivers/odbc/odbc_result.php | 35 |
2 files changed, 36 insertions, 2 deletions
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 2217e974e..01515221b 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -288,8 +288,7 @@ class CI_DB_odbc_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; diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index 042c915f9..219d16fa3 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -272,6 +272,41 @@ class CI_DB_odbc_result extends CI_DB_result { return $this->result_array; } + // -------------------------------------------------------------------- + + /** + * Query result. Object version. + * + * @return array + */ + public function result_object() + { + if (count($this->result_object) > 0) + { + return $this->result_object; + } + elseif (($c = count($this->result_array)) > 0) + { + for ($i = 0; $i < $c; $i++) + { + $this->result_object[$i] = (object) $this->result_array[$i]; + } + } + elseif ($this->result_id === FALSE) + { + return array(); + } + else + { + while ($row = $this->_fetch_object()) + { + $this->result_object[] = $row; + } + } + + return $this->result_object; + } + } /* End of file odbc_result.php */ |