Forum Moderators: coopster
When I do the query
INSERT INTO forms (table,universal_id,submitted,submitted_by,notes,processed,charged) VALUES ('wqeqwew', '0', 'wqewqe', 'sDwed', 'wqewqe', '23wqe', 'qweasd')
I get
Could not query: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 'table,universal_id,submitted,submitted_by,notes,processed,charg
when I do the query
INSERT INTO forms VALUES ('wqeqwew', '0', 'wqewqe', 'sDwed', 'wqewqe', '23wqe', 'qweasd')
It works.
What in the world is the problem with my syntax?
INSERT INTO forms (`table`,`universal_id`,`submitted`,`submitted_by`,`notes`,`processed`,`charged`) VALUES ('wqeqwew', '0', 'wqewqe', 'sDwed', 'wqewqe', '23wqe', 'qweasd')
Incidentally, there is nothing wrong with the single-quotes around integer or other non-character types - in fact it is good practice - especially in a web environment where you might be constructing a query from untrusted user input.
Baze: I had the same misconception about quoting numbers until a few months ago. It sure makes life easier (and safer) to just quote everything--except NULL--don't do that. Is there anything else that can't be quoted?