Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.
X

Using MYSQL reserved words as column name

I recently ran into problem with a script that has one of it's column names as "signal". The script keeps giving erorr and failing whenever I run the SQL command. Checking MYSQL documentation, I realised that signal is one of MYSQL reserved words.

To solve this, use backticks `.


CREATE TABLE my_table (
`signal` varchar(100)
)

	

Remember to always use them in your queries as well eg SELECT `signal` FROM my_table

I really won't use reserved words for column names if I worked on this though, but in this case I guess I need to.


comments powered by Disqus