[Typo3-dev] quoting SQL-identifiers

Martin Kutschker martin.kutschker at no5pam.blackbox.net
Mon Jun 6 13:21:14 CEST 2005


"Martin Kutschker" <martin.kutschker at no5pam.blackbox.net> schrieb im 
Newsbeitrag 
news:mailman.1.1114164048.31031.typo3-dev at lists.netfielders.de...
> Hi!
>
> It's possible to quote SQL-identifiers (eg table names) to avoid a clash 
> with reserved names.
>
> It seems that ANSI-standard are " (double quotes). Mysql uses ` (back 
> ticks) unless in ANSI mode (SET sql_mode='ANSI_QUOTES'). But you need 
> 3.23.6 to get quoting at all. How about other RDBMS'?

Just found out that MS SQL uses square brackets (!) , eg [table] and accepts 
double quotes only if a config variable is set. So the "ANSI-only" option is 
none.

> Possible soultion (if needed at all):
>
> t3lib_db->quoteIdentifier($ident)

I still think this would be the best as it is safe for the TYPO3's default 
RDBMS (Mysql).

Masi 






More information about the TYPO3-dev mailing list