On 05.08.2008, at 09:34, Lester Caine wrote:
Larry Garfield wrote:
I'm building a multi-database system, although my main targets are
MySQL, Postgres, and SQLite.
How would those handle something like "a string that ends in 100%"?
Personally this is one of the reasons that PDO has never attracted
me. Providing the tools to flatten some of the differences between
*SQL* variations is just as important as flattening the name
differences in functions.
My own use of LIKE tends to process the string and then add the
wrapping %% when passing it to the param array, but do all databases
HANDLE 'escaped %' in the LIKE data? Firebird allows a escape
character but you need to include it in the SQL
LIKE '%100#%%' ESCAPE '#'
But I think MySQL actually uses \% to achieve the same thing -
and the ESCAPE '\' is then optional?
Have a look at PEAR::MDB2
http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Driver_Datatype_Common.html#methodmatchPattern
This method also deals with case sensitivity. The API is not really a
beauty, but it gets the job done.
regards,
Lukas Kahwe Smith
[EMAIL PROTECTED]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php