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
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
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I found the answer in an online article.
Officially the double quotes are name delimiters, so "My Project" could work. MySQL might have a different point of view, however.
set [My Project]=23
where id=16;