Mysql 意外的性格。(接近于“?”)

Mysql 意外的性格。(接近于“?”),mysql,Mysql,我试图在phpMyAdmin中执行以下查询,但出现了错误。我已经查看了类似的问题,但我仍然不明白为什么它不起作用 INSERT INTO discussion_forum (event_type, title) VALUES ('edx.forum.thread.viewed', 'Which of the stories you've seen or read can you relate to? Why?') 静态分析是 3 errors were found during analysi

我试图在phpMyAdmin中执行以下查询,但出现了错误。我已经查看了类似的问题,但我仍然不明白为什么它不起作用

INSERT INTO discussion_forum (event_type, title) VALUES ('edx.forum.thread.viewed', 'Which of the stories you've seen or read can you relate to? Why?')
静态分析是

3 errors were found during analysis.

Unexpected character. (near "?" at position 143)
Unexpected character. (near "?" at position 148)
Ending quote ' was expected. (near "" at position 151)

谢谢您的时间。

通过加倍来逃避

'Which of the stories you''ve seen or read can you relate to? Why?'
字符串中有引号('),应使用反斜杠(\)将其转义


你的问题是“这个”,所以你需要像下面这样改变它

INSERT INTO discussion_forum (event_type, title) VALUES ('edx.forum.thread.viewed', 'Which of the stories you\'ve seen or read can you relate to? Why?')

使用双引号(“)由于字符串中有单引号,这将导致抛出错误
\'
可能在某些SQL引擎中起作用,但标准规定单引号由附加的单引号转义,如Srinivasan Sekar的解决方案中所述。具体而言,
\'
仅在
无反斜杠转义
模式未激活时才能在MySQL上起作用。
INSERT INTO discussion_forum (event_type, title) VALUES ('edx.forum.thread.viewed', 'Which of the stories you\'ve seen or read can you relate to? Why?')