简体   繁体   English

为什么这个正确转义的SQL查询失败了?

[英]Why does this properly escaped SQL query fail?

Here's the query: 这是查询:

INSERT INTO jobemails (jobid, to, subject, message, headers, datesent) VALUES ('340', 'jrhodes@jhu.edu', 'We\'ve received your request for a photo shoot called \'another\'.', 'message', 'headers', '2010-04-22 15:55:06')

The datatypes are all correct, it always fails at the subject, so it must be how I'm escaping the values, I assume. 数据类型都是正确的,它总是在主题上失败,所以它必须是我如何逃避值,我假设。

I'm sure one of you will see my idiot mistake right away. 我相信你们中的一个人会马上看到我的白痴错误。 A little help? 一点帮助?

SQL is confusing 'to' from row to a function. SQL从行到函数混淆了'to'。

Try: 尝试:

INSERT INTO `jobemails` (`jobid`, `to`, `subject`, `message`, `headers`, `datesent`) VALUES ('340', 'jrhodes@jhu.edu', 'We\'ve received your request for a photo shoot called \'another\'.', 'message', 'headers', '2010-04-22 15:55:06')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM