[TYPO3-dev] Reserved keywords on fields and table names in the database
Ries van Twisk
typo3 at rvt.dds.nl
Mon May 15 14:36:23 CEST 2006
Patrick Broens wrote:
>Already corrected. This was a fieldname that wasn't even in use.
>
>
Thanks patrick for corre ting this, You extension was just an example I
cam across.
Maby we can put in the coding quidelines that extension developers just
need to quote there keywords.
Like martin pointed out already correctly a quoteIdentifier function
would help a lot. I would say give it a array and let it do the quoting
for us.
$GLOBALS['TYPO3_DB']->quoteIdentifier(array('uid', 'pid', 'title), 'pages');
Which returns a quoted comma separated string depending on the used DB
$GLOBALS['TYPO3_DB']->quoteIdentifier(array('uid' => 'myuid', 'pid' => 'justpid', 'title), 'pages');
Which returns : uid AS myuid, pid AS justpid, title
The above would be easy for everybody to use and to update exisiting code aswell.
We can also directly assign a array to the fields variable and do the quoting IN the different DBAL functions.
Ries
>Patrick
>
>Ries van Twisk wrote:
>
>
>>Hey All,
>>
>>
>
>
>
>>However, how can I be sure that the extensions works now? (I mailed
>>Patrick about this).
>>
>>
>>
>
>_______________________________________________
>TYPO3-dev mailing list
>TYPO3-dev at lists.netfielders.de
>http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>
>
--
Ries van Twisk
Freelance Typo3 Developer
=== Private:
email: ries at vantwisk.nl
web: http://www.rvantwisk.nl/freelance-typo3.html
skype: callto://r.vantwisk
=== Work:
email: ries at livetravelguides.com
web: http://www.livetravelguides.com
More information about the TYPO3-dev
mailing list