diff options
author | Juan Ignacio Borda <juanignacioborda@gmail.com> | 2012-05-18 23:27:50 +0200 |
---|---|---|
committer | Juan Ignacio Borda <juanignacioborda@gmail.com> | 2012-05-18 23:27:50 +0200 |
commit | 3020b24545381a72add33d67a488a7e39674ec7e (patch) | |
tree | f02fb88f22bc33f29d99f3aa16bb3380cb3e8744 /system | |
parent | 1ef19196e32d081bd5db1a7f87599acea0ecac6e (diff) |
added unbuffered_row() to DB_result.php to avoid memory exhausting when dealing with large results.
Diffstat (limited to 'system')
-rw-r--r-- | system/database/DB_result.php | 18 |
1 files changed, 18 insertions, 0 deletions
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 @@ -371,6 +371,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 * is used. When caching is enabled we do not load the other driver. |