Link to home
Create AccountLog in
Avatar of Nemetona
Nemetona

asked on

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

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
Avatar of Eyal
Eyal
Flag of Israel image

Update mydatabase
set [My Project]=23
where id=16;
ASKER CERTIFIED SOLUTION
Avatar of Nemetona
Nemetona

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Nemetona
Nemetona

ASKER

I found the answer in an online article.
Avatar of Qlemo
Officially the double quotes are name delimiters, so "My Project" could work. MySQL might have a different point of view, however.