4

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?

rhodesjason
  • 4,904
  • 9
  • 43
  • 59

1 Answers1

8

SQL is confusing 'to' from row to a function.

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')
Nican
  • 7,825
  • 3
  • 27
  • 26
  • 1
    I am the absolute WORST about that. I need to change the name of that column in mysql and STOP USING MYSQL RESERVED WORDS for column names. Geez! Thanks, Nican. – rhodesjason Apr 22 '10 at 20:07
  • It only makes sense to avoid spammers. Thank you for taking your time to reward me. – Nican Apr 22 '10 at 20:14