From 3020b24545381a72add33d67a488a7e39674ec7e Mon Sep 17 00:00:00 2001 From: Juan Ignacio Borda Date: Fri, 18 May 2012 18:27:50 -0300 Subject: added unbuffered_row() to DB_result.php to avoid memory exhausting when dealing with large results. --- system/database/DB_result.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'system/database/DB_result.php') diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 196febe2c..574cd9858 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -370,6 +370,24 @@ class CI_DB_result { // -------------------------------------------------------------------- + /** + * Returns an unbuffered row and move pointer to next row + * + * @return object + */ + public function unbuffered_row($type = 'object') + { + if ($type == 'object') + { + return $this->_fetch_object(); + } else + { + return $this->_fetch_assoc(); + } + } + + // -------------------------------------------------------------------- + /** * The following functions are normally overloaded by the identically named * methods in the platform-specific driver -- except when query caching -- cgit v1.2.3-24-g4f1b