0
Insert into DonutOrder (Date, Special Handling Notes)
Values ("20140506", "Please Include Plates and Napkins");

I keep getting this response Error SQL query:

Insert into DonutOrder (Date, Special Handling Notes);

MySQL said: Documentation

#1064 - 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 'Handling Notes)' at line 1

Dharman
  • 30,962
  • 25
  • 85
  • 135
Ken Weger
  • 41
  • 6

1 Answers1

1

Well, your identifier (column name) has spaces, so you should escape it with backticks:

insert into `DonutOrder` (`Date`, `Special Handling Notes`) Values ("20140506", "Please Include Plates and Napkins");
potashin
  • 44,205
  • 11
  • 83
  • 107
  • Or rather OP should use sane names for his fields. – PeeHaa Oct 27 '15 at 21:52
  • @PeeHaa: Well, yeah, unless it is not his own invention – potashin Oct 27 '15 at 21:54
  • Thank you for the information i am now not getting that error code but a different one about foreign key constraints even though i am not trying to update anything in those columns. This is all for a school project i am in the last stages of completing it but having several problems with syntax errors the new error is code 1452 cannot add or update a child row foreign key constraint fails – Ken Weger Oct 28 '15 at 16:34