Select query not working when trying to get records for column with column name 'ssl'

Can someone please tell me what is wrong with this query?

mysql> select dom_id, ssl from hosting;

      

I am getting below error:

ERROR 1064 (42000): 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 'ssl from hosting' at line 1

      

If I remove the ssl then the query gives the result as it should.

Note. Both dom_id and ssl are two columns of the hosting table.

+3


source to share


2 answers


Try this

select `dom_id`, `ssl` from hosting;

      



ssl is a keyword for mysql. So please use "` "this sign

+3


source


All MySQL reserves the shloud words between "` "to work properly.



0


source







All Articles