【发布时间】:2015-04-16 08:15:09
【问题描述】:
当我尝试使用特殊字符更新我的值时出现此错误
消息:SQLSTATE[42000]:语法错误或访问冲突:1064 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的 't' WHERE (idcommentaire = 117)' 附近使用正确的语法。失败的查询:“UPDATE commentaire SET commentaire = 'test't' WHERE (idcommentaire = 117 )"
UPDATE commentaire SET commentaire = 'test't' WHERE (idcommentaire = 117)
^
为什么学说不管理特殊字符?
我的功能:
static public function modifierCommentaire($id, $commentaire)
{
$req = Doctrine_Query::create()
->update('Commentaire c')
->set('c.commentaire ', $commentaire)
->where("c.idcommentaire=$id")
->execute();
}
【问题讨论】:
标签: php doctrine doctrine-1.2