summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/odbc/odbc_result.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/odbc/odbc_result.php')
-rw-r--r--system/database/drivers/odbc/odbc_result.php71
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 */