No subject


Tue Sep 22 12:00:10 CEST 2009


 *  451:     function SELECTquery($select_fields,$from_table,$where_clause,$groupBy='',$orderBy='',$limit='')

So you now know which parameter goes where.
So the correct approach would be:
-------------------------------------------------------
// Sanitize uid-list
$uidList = t3lib_div::intExplode(',', $stringUidList);
$uidList = '0'.implode(',', $uidList);

// Get "where" statement for enableField (hidden=0 AND deleted=0)
$enableFields = $GLOBALS['TSFE']->sys_page->enableFields('mytable');

// Do the query
The $GLOBALS['TYPO3_DB']->SELECTquery('*', 'mytable', 'uid IN ('.$uidList.')'.$enableFields);
-------------------------------------------------------

Got it?
You could also use "->exec_SELECTquery" to directly execute the query. The method you choose ->SELECTquery
only returns the query as string, and you have to do ->sql_query(). Using "->exec_SELECTquery" directly
returns a mysql result resource.

And if you know that not too many result rows will get returned you could also use:

->exec_SELECTgetRows()

Which directly returns an array containing all result rows. You can then iterate over this array using
"foreach". Have a look at "t3lib/class.t3lib_db.php"


greets,
Bernhard





More information about the TYPO3-english mailing list