We help IT Professionals succeed at work.

How can I referece a field name which has a space in it

Nemetona
Nemetona asked
on
I have a field in a table in an mysql database which has been named My Project.  I would like to know how to update that field as I get an error message because of the space between My and Project.

Update mydatabase
set My Project=23
where id=16;

I have tried single quotes, square brackets, hash marks etc but have had no luck.  I cannot change the field name at this point.

Can anyone help, please
Comment
Watch Question

Commented:
Update mydatabase
set [My Project]=23
where id=16;
Commented:
Hi, square brackets did not work for me.  In the end I found that backticks (the key to the left of the 1 on the keyboard) were the answer.

Author

Commented:
I found the answer in an online article.
Qlemo"Batchelor", Developer and EE Topic Advisor
CERTIFIED EXPERT
Top Expert 2015

Commented:
Officially the double quotes are name delimiters, so "My Project" could work. MySQL might have a different point of view, however.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.