Home » Php » php – Blank spaces in column names with MySQL

php – Blank spaces in column names with MySQL

Posted by: admin July 12, 2020 Leave a comment

Questions:

One of the column names in my database is two words long, including a blank space, i.e.: Area One. I am using SELECT and referring to the column names to pull the data I want. Now if I name the column _Area_One_, my SELECT works, but if I use _Area One_, it does not. It says Unknown column ‘Area’ in ‘field list’

Ideas?

How to&Answers:

Use backticks.

SELECT * FROM `Area One`