it seems that Zend_Db does not escape backslashes right - or I'm doing something wrong:
in my db table "dir" I have a column named "path" with the folowing entry:
C:\some\path\with\backslahes
In my DbTable class I'm doing something like:
$path = "C:\some\path\with\backslahes"; // in reality the value comes from a config.ini
$this->fetchAll(
$this->select()->where('path LIKE ?', $path));
Now Zend_Db generates the following query:
SELECT `dir`.* FROM `dir` WHERE (path LIKE 'C:\\some\\path\\with\\backslahes')
This is wrong and the corresponding row never gets matched.
It must be the following SQL query to match the right row(s):
SELECT `dir`.* FROM `dir` WHERE (path LIKE 'C:\\\\some\\\\path\\\\with\\\\backslahes')
Can somebody confirm this issue?
Regards
Viktor
没有评论:
发表评论