[TYPO3-dev] SQL parameter binding

Jigal van Hemert jigal at xs4all.nl
Sun Jun 13 23:12:37 CEST 2010


Martin Kutschker wrote:
> Xavier Perseguers schrieb:
>> Hi Attila,
>>
>>> Is there a way to use sql parameter binding in an extension? I mean
>>> something like mysqli_stmt_bind_param.
>> Not at the moment. I mean it's not part of the t3lib_db API.
>>
>> However this is something I already planned to work on for TYPO3 4.5 as
>> it would allow a huge step forward in term of speed when used with DBAL.
> 
> Would you try to add mysqli support directly into the Core to get stuff like that into 4.x?

Situation is that since PHP 5.0 MySQL support isn't enabled by default, 
but since PHP 5.1.0 PDO (and the PDO_SQLITE driver) is enabled by default.
So with a minimum of 5.2 we can be pretty sure that PDO is available.

PDO also supports parameter binding (and more) and with appropriate PDO 
"drivers" it supports quite a number of DBMSs. Together with DBAL query 
rewriting this could be a good foundation.

A few speed tests are needed, but the huge speed difference of PDO 
compared to mysql(i) in older versions of PHP seems to be gone.

After introducing something similar to parameter binding in Typoscript 
for 4.4 this seems like a nice project for 4.5 :-)

[1] http://www.php.net/manual/en/mysqli.installation.php
[2] http://www.php.net/manual/en/pdo.installation.php

-- 
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh




More information about the TYPO3-dev mailing list