Roberto Torresani schrieb:

> The $GLOBALS['TYPO3_DB']->SELECTquery('*', 'mytable') show me all my
> records, but I don't find how select the only ones with, for example, the
> foreign uid "3" in the list field.

>From t3lib/class.t3lib_db.php:

 *  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



_______________________________________________
TYPO3-english mailing list
[email protected]
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english

Reply via email to