Are quotes around tables and columns in a MySQL query really necessary?
mysql, php
Solution
What if you have a table named `table`, or a column named `where`. These are reserved keywords. If you used those in your queries without backticks, they'd produce an invalid query (Of course, using reserved keywords is bad practice).
SELECT something FROM table WHERE where = 1;
vs.
SELECT something FROM `table` WHERE `where` = 1;
Problem
I have a short question about mysql query. What is correct? ``` SELECT * FROM Persons WHERE Year='1965' ``` Or ``` SELECT * FROM `Persons` WHERE `Year` = '1965' ``` Is this a personal choice or is this something what is really wrong?