For some reason, the developers at a new company I’m working for decided to name their columns “ignore” and “exists”. Now when I run MySQL queries with those words in the where clause, I get a syntax error; however, I can’t seem to figure out how to reference those columns without running into an error. I tried setting them as strings, but that doesn’t make any sense.
Help?
Also, is there a term for this kind of mismatch?
put the names in backticks:
If you’re working across multiple tables or databases you need to escape the database name, table name, and field name separately (if each matches a keyword):
Only the portions that actually match a keyword have to be escaped, so things like:
are ok too.