From 9c68c3173c84041b1ee77929e540a4a4382edeee Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 6 Mar 2012 10:34:58 +0200 Subject: Fix issue #1125 ... for real --- system/database/drivers/odbc/odbc_result.php | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'system/database/drivers/odbc') diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index 2d5b50a8d..de2c58cb9 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -280,6 +280,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 */ -- cgit v1.2.3-24-g4f1b