[TYPO3-dev] DB query iterator; worth a try?
Martin Kutschker
masi-no at spam-typo3.org
Fri Apr 23 08:39:36 CEST 2010
Jigal van Hemert schrieb:
>
> function exec_SELECTiterator ($select_fields, $from_table,
> $where_clause, $groupBy='', $orderBy='', $limit='') {
> $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields,
> $from_table, $where_clause, $groupBy, $orderBy, $limit);
> return new databaseIterator($res);
> }
>
> Allows you to simply use a foreach directly on the iterator:
>
> $res = $this->exec_SELECTiterator( ....parameters.... );
> foreach ($res as $row) {
> // do what you want with the row
> }
You can already use exec_SELECTgetRows() if foreach() is all you need.
Masi
More information about the TYPO3-dev
mailing list