@@ -12,7 +12,8 @@ There are several ways to generate query results:
1212Result Arrays
1313*************
1414
15- **getResult() **
15+ getResult()
16+ ===========
1617
1718This method returns the query result as an array of **objects **, or
1819**an empty array ** on failure. Typically you'll use this in a foreach
@@ -36,7 +37,8 @@ instantiate for each result object
3637
3738The above method is an alias of ``getCustomResultObject() ``.
3839
39- **getResultArray() **
40+ getResultArray()
41+ ================
4042
4143This method returns the query result as a pure array, or an empty
4244array when no result is produced. Typically you'll use this in a foreach
@@ -48,7 +50,8 @@ loop, like this:
4850Result Rows
4951***********
5052
51- **getRow() **
53+ getRow()
54+ ========
5255
5356This method returns a single result row. If your query has more than
5457one row, it returns only the first row. The result is returned as an
@@ -66,7 +69,8 @@ to instantiate the row with:
6669
6770.. literalinclude :: results/007.php
6871
69- **getRowArray() **
72+ getRowArray()
73+ =============
7074
7175Identical to the above ``row() `` method, except it returns an array.
7276Example:
@@ -81,24 +85,25 @@ digit in the first parameter:
8185In addition, you can walk forward/backwards/first/last through your
8286results using these variations:
8387
84- | ** $row = $query->getFirstRow()**
85- | ** $row = $query->getLastRow()**
86- | ** $row = $query->getNextRow()**
87- | ** $row = $query->getPreviousRow()**
88+ | `` $row = $query->getFirstRow()``
89+ | `` $row = $query->getLastRow()``
90+ | `` $row = $query->getNextRow()``
91+ | `` $row = $query->getPreviousRow()``
8892
8993By default they return an object unless you put the word "array" in the
9094parameter:
9195
92- | ** $row = $query->getFirstRow('array')**
93- | ** $row = $query->getLastRow('array')**
94- | ** $row = $query->getNextRow('array')**
95- | ** $row = $query->getPreviousRow('array')**
96+ | `` $row = $query->getFirstRow('array')``
97+ | `` $row = $query->getLastRow('array')``
98+ | `` $row = $query->getNextRow('array')``
99+ | `` $row = $query->getPreviousRow('array')``
96100
97101.. note :: All the methods above will load the whole result into memory
98102 (prefetching). Use ``getUnbufferedRow() `` for processing large
99103 result sets.
100104
101- **getUnbufferedRow() **
105+ getUnbufferedRow()
106+ ==================
102107
103108This method returns a single result row without prefetching the whole
104109result in memory as ``row() `` does. If your query has more than one row,
@@ -145,7 +150,8 @@ In addition to the two methods listed below, the following methods also can
145150take a class name to return the results as: ``getFirstRow() ``, ``getLastRow() ``,
146151``getNextRow() ``, and ``getPreviousRow() ``.
147152
148- **getCustomResultObject() **
153+ getCustomResultObject()
154+ =======================
149155
150156Returns the entire result set as an array of instances of the class requested.
151157The only parameter is the name of the class to instantiate.
@@ -154,7 +160,8 @@ Example:
154160
155161.. literalinclude :: results/014.php
156162
157- **getCustomRowObject() **
163+ getCustomRowObject()
164+ ====================
158165
159166Returns a single row from your query results. The first parameter is the row
160167number of the results. The second parameter is the class name to instantiate.
@@ -173,21 +180,24 @@ Example:
173180Result Helper Methods
174181*********************
175182
176- **getFieldCount() **
183+ getFieldCount()
184+ ===============
177185
178186The number of FIELDS (columns) returned by the query. Make sure to call
179187the method using your query result object:
180188
181189.. literalinclude :: results/017.php
182190
183- **getFieldNames() **
191+ getFieldNames()
192+ ===============
184193
185194Returns an array with the names of the FIELDS (columns) returned by the query.
186195Make sure to call the method using your query result object:
187196
188197.. literalinclude :: results/018.php
189198
190- **getNumRows() **
199+ getNumRows()
200+ ============
191201
192202The number of records returned by the query. Make sure to call
193203the method using your query result object:
@@ -198,7 +208,8 @@ the method using your query result object:
198208 CodeIgniter will fetch and buffer the query result records internally and
199209 return a count of the resulting record array, which can be inefficient.
200210
201- **freeResult() **
211+ freeResult()
212+ ============
202213
203214It frees the memory associated with the result and deletes the result
204215resource ID. Normally PHP frees its memory automatically at the end of
@@ -210,7 +221,8 @@ Example:
210221
211222.. literalinclude :: results/020.php
212223
213- **dataSeek() **
224+ dataSeek()
225+ ==========
214226
215227This method sets the internal pointer for the next result row to be
216228fetched. It is only useful in combination with ``getUnbufferedRow() ``.
0 commit comments