summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/results.rst
diff options
context:
space:
mode:
authorJuan Ignacio Borda <juanignacioborda@gmail.com>2012-05-18 23:29:24 +0200
committerJuan Ignacio Borda <juanignacioborda@gmail.com>2012-05-18 23:29:24 +0200
commitd981e2915cbd37f866e6f74c3a86a41e8a43e02e (patch)
tree92bd074bcef4d74f390d70760837584374c8285a /user_guide_src/source/database/results.rst
parent3020b24545381a72add33d67a488a7e39674ec7e (diff)
Added doc notes for unbuffered_row() function
Diffstat (limited to 'user_guide_src/source/database/results.rst')
-rw-r--r--user_guide_src/source/database/results.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst
index 865345762..6a0dbf92a 100644
--- a/user_guide_src/source/database/results.rst
+++ b/user_guide_src/source/database/results.rst
@@ -136,6 +136,26 @@ parameter:
| **$row = $query->next_row('array')**
| **$row = $query->previous_row('array')**
+.. note:: all the functions above will load the whole result into memory (prefetching) use unbuffered_row() for processing large result sets.
+
+unbuffered_row($type)
+=====
+
+This function returns a single result row without prefetching the whole result in memory as row() does.
+If your query has more than one row, it returns the current row and moves the internal data pointer ahead.
+The result is returned as $type could be 'object' (default) or 'array' that will return an associative array.
+
+
+
+ $query = $this->db->query("YOUR QUERY");
+
+ while ($row=$query->unbuffered_rows())
+ {
+ echo $row->title;
+ echo $row->name;
+ echo $row->body;
+ }
+
***********************
Result Helper Functions
***********************