| @@ 201-218 (lines=18) @@ | ||
| 198 | $i = 0 ; |
|
| 199 | ||
| 200 | // ok, we have a result with one or more rows, loop out the rows and output as array |
|
| 201 | while($row = $stmt->fetch($method)){ |
|
| 202 | $key = $i; |
|
| 203 | ||
| 204 | if($assoc && !empty($index)){ |
|
| 205 | ||
| 206 | if($fetch_array && isset($row[$index])){ |
|
| 207 | $key = $row[$index]; |
|
| 208 | } |
|
| 209 | else if(isset($row->{$index})){ |
|
| 210 | $key = $row->{$index}; |
|
| 211 | } |
|
| 212 | ||
| 213 | } |
|
| 214 | ||
| 215 | $out[$key] = $row; |
|
| 216 | $i++; |
|
| 217 | ||
| 218 | } |
|
| 219 | ||
| 220 | return $out; |
|
| 221 | } |
|
| @@ 193-209 (lines=17) @@ | ||
| 190 | $i = 0 ; |
|
| 191 | ||
| 192 | // ok, we have a result with one or more rows, loop out the rows and output as array |
|
| 193 | while($row = $result->{$method}()){ |
|
| 194 | $key = $i; |
|
| 195 | ||
| 196 | if($assoc && !empty($index)){ |
|
| 197 | ||
| 198 | if($fetch_array && isset($row[$index])){ |
|
| 199 | $key = $row[$index]; |
|
| 200 | } |
|
| 201 | elseif(isset($row->{$index})){ |
|
| 202 | $key = $row->{$index}; |
|
| 203 | } |
|
| 204 | ||
| 205 | } |
|
| 206 | ||
| 207 | $out[$key] = $row; |
|
| 208 | $i++; |
|
| 209 | } |
|
| 210 | ||
| 211 | $result->free(); |
|
| 212 | ||