0

working query

non-working query The first query:

INSERT INTO `data` (`id`, `data`)
    VALUES (NULL, 'more data'); (working)

And the second:

INSERT INTO 'data' ('id', 'data')
    VALUES (NULL, 'more data'); (non-working)

Please tell me what is the difference between them cause I learn to use single quote(') for query in school instead of back tick? (`), is it a new feature or is it always what it is?

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786
  • You have single quotes around column names in the second query. I vote to close such questions as a typographical error. Single quotes should *only* be used for string and date constants. If you learned otherwise, you learned bad practices. – Gordon Linoff Mar 04 '17 at 15:50
  • The difference is that you learned standard SQL, while MySQL was written for people who don't really care about the standard and just want something close enough that works. – Nic Mar 04 '17 at 15:59

0 Answers0