【发布时间】:2018-06-12 03:57:35
【问题描述】:
我有 JSON 数据,例如 'Courses Offered': "Economics,World history: survey,Women's history,Other social science course"}
由于Women's history 它给出了错误:
'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'s history,Other social science course"}]
我尝试将' 替换为"'',但没有成功
【问题讨论】:
-
你试过在引号前加`\`反斜杠吗?
-
您正在通过字符串连接构建 SQL。不要那样做。曾经。用户参数。
-
这不是有效的 JSON。 JSON 仅使用双引号字符串。
-
@Tomalak 成功了!!!
-
@Volatil3 贴出你用过的相关代码,我点赞。