summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/results.rst
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2012-05-21 14:38:57 +0200
committerTimothy Warren <tim@timshomepage.net>2012-05-21 14:38:57 +0200
commit4b5616d5dc6ce118a472333b59f23e6eaf735144 (patch)
tree45e8c1115e6eedd30575db77dfdd9c8864272c2b /user_guide_src/source/database/results.rst
parent0ab28ced4d4f20d5857fae9ec0e20452d4ac181b (diff)
parent1d79efea47d26e0e567f919c648adf5b554f3ff0 (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into email
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..ac4fc3733 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_row())
+ {
+ echo $row->title;
+ echo $row->name;
+ echo $row->body;
+ }
+
***********************
Result Helper Functions
***********************