0

I have a problem with a small query. When I execute it I am getting a error which is

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 'key=stqq WHERE id=75' at line 1

My query is as follows

UPDATE roles SET name=stylistqq, key=stqq WHERE id=75
1
  • 1
    key is a reserved word in mySQL. You should use a different column name Commented Mar 22, 2011 at 18:53

2 Answers 2

1

add quotes

UPDATE roles SET name='stylistqq', key='stqq' WHERE id=75
Sign up to request clarification or add additional context in comments.

Comments

1

Are stylistqq and stqq strings? If so, they should have single quotes around them. Pekka's recommendation to use a different column name other than key is also a good idea. You can make MySQL take that string by putting backticks around it, but you'll always need them.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.