[TYPO3-core] RFC: MM_foreign_select
Martin Kutschker
Martin.Kutschker at blackbox.net
Wed Mar 8 16:23:37 CET 2006
Franz Holzinger <franz at fholzinger.com> writes on
Wed, 08 Mar 2006 16:17:12 +0100 (MET):
>
> > + foreach($tableArr as $foreignTable) {
> > + $whereArr[] =
> > 'tablenames='.$GLOBALS['TYPO3_DB']->fullQuoteStr($foreignTable,
> > $tableName);
> > + }
> > + $where.= ' AND ( '.implode(' OR ', $whereArr).' ) ';
>
> Why do you not use 'WHERE tablenames IN ('table1', 'table2', ...
> 'tablen')' ?
Don't use fullQuoteStr on anything else than values!
TYPO3 lacks a quoteIdentifier function. I write one once, but stopped to write a patch when I realized that there are so mamy places in TYPO3 where tables are not quoted that I gave up.
Warning: identifiers (table, column and function names) have to be quoted differently than values. Some examples:
ANSI: 'identifier' <> "value"
Mysql: `identifier` <> 'value'
MSSQL: [identifier] <> "value"
Mysql and MSSQL can be configured to accept ANSI quoting as well.
Masi
More information about the TYPO3-team-core
mailing list