开发者

mysql_real_escape_string For doctrine (symfony)?

开发者 https://www.devze.com 2023-02-12 08:15 出处:网络
Is there mysql_real_escape_string for doctrine? Because I have a query like 开发者_运维问答 ?´## \'´` ^#11 \" dfvü:?=._`ßß?(%%/ \'

Is there mysql_real_escape_string for doctrine?

Because I have a query like

开发者_运维问答
?´## '´` ^#11 " dfvü:?=._`ßß?(%%/ '

and i must escape it, before i give it to Doctrine_Query::create()


Doctrine handles escaping internally. Use a query like:

$q = Doctrine_Query::create()->from('MyTable m')->where('m.column = ?', '?´## \'´^#11 " dfvü:?=._ßß?(%%/');

And the characters will be escaped to be safe for your database.


It cannot work, because

where('m.column = ?', '?´## '´^#11 " dfvü:?=._ßß?(%%/');

Here are three apostrophes

'?´## '´^#11 " dfvü:?=._ßß?(%%/'
0

精彩评论

暂无评论...
验证码 换一张
取 消