0

I have the following line of code.

UPDATE account 
SET BlockMessage='$BlockMessage', SET BlockAdmin='$AdminUsername', Status=2 
WHERE ID='$ID'

As you can see in trying to set a "BlockMessage, BlockAdmin and Status" in 1 single query. The Infomation is correctly displayed if I echo the 3 individual Variables. however, when running the SQL String it only updates the Block Message row.

Any Ideas?

1
  • 1
    That statement is invalid SQL. SET may only be used once in an UPDATE statement. Commented May 12, 2017 at 12:03

2 Answers 2

1

You have an extra SET. Update should be something like this:

UPDATE account 
SET 
  BlockMessage='$BlockMessage', 
  BlockAdmin='$AdminUsername', 
  Status=2 
WHERE ID='$ID'
Sign up to request clarification or add additional context in comments.

Comments

0

You need use the keyword SET only once like

SET BlockMessage='$BlockMessage', 
BlockAdmin='$AdminUsername', 
Status=2

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.