[TYPO3-core] RFC #13467: add getField() function to database API

Jigal van Hemert jigal at xs4all.nl
Sat Apr 10 01:29:15 CEST 2010


Ernesto Baschny [cron IT] wrote:
> We could make a cooler "getRows()" alternative which returns an object
> that implements "Iterator" [1] and which internally does the
> sql_fetch_assoc, sql_data_seek etc.

I was almost tempted to object on the fact that it was labelled as "cooler".

>  $rows = DB->exec_SELECTgetRowsIterator(blabla);
>  foreach ($rows as $row) {
>     // do stuff
>  }

This is much cleaner than the sql_fetch_assoc stuff. However, as getting 
data from query results is something which is done a lot during the 
construction of a page with content, I'd like to see/do some speed tests 
first before the whole db interface is "iteratorized".

I like a database class which does all the work by itself and only when 
needed. Just create the instance (with connection data), set the query 
and start getting the data...

-- 
Jigal van Hemert.


More information about the TYPO3-team-core mailing list