diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-09 13:51:55 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-09 13:51:55 +0100 |
commit | 334fb92c1754e403c8308f4c2cb9492700d7b1a5 (patch) | |
tree | 4ce3243d214073bcbd4ee682902baa17b813c0b1 /system/database/drivers/odbc/odbc_result.php | |
parent | 34f75799285ca39741deaba9955ea07e6b9756a5 (diff) | |
parent | c016a1102e2a77e0c27b9656c19a0460df24dfb6 (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/drivers/odbc/odbc_result.php')
-rw-r--r-- | system/database/drivers/odbc/odbc_result.php | 71 |
1 files changed, 70 insertions, 1 deletions
diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index 572e110ca..de2c58cb9 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -245,8 +245,77 @@ class CI_DB_odbc_result extends CI_DB_result { return $rs_assoc; } -} + // -------------------------------------------------------------------- + + /** + * Query result. Array version. + * + * @return array + */ + public function result_array() + { + if (count($this->result_array) > 0) + { + return $this->result_array; + } + elseif (($c = count($this->result_object)) > 0) + { + for ($i = 0; $i < $c; $i++) + { + $this->result_array[$i] = (array) $this->result_object[$i]; + } + } + elseif ($this->result_id === FALSE) + { + return array(); + } + else + { + while ($row = $this->_fetch_assoc()) + { + $this->result_array[] = $row; + } + } + 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 */ /* Location: ./system/database/drivers/odbc/odbc_result.php */ |