1

So I keep getting SQL syntax error when trying to run the following:

UPDATE tickets SET (ticket_urgency, ticket_status) VALUES ('Urgent', 'new') WHERE ticket_id='14'

Not sure what is wrong with this? I tried INSERT INTO aswell, but the tricky part here is the WHERE tiket_id='x'.

user1868565
  • 141
  • 1
  • 3
  • 8

2 Answers2

4

the syntax of UPDATEshould be like this,

UPDATE tickets 
SET    ticket_urgency = 'Urgent', 
       ticket_status = 'new'
WHERE  ticket_id='14'

for further knowledge, your query is vulnerable to SQL Injection if the values came from a variable, to protect from it, please read the article below

Community
  • 1
  • 1
John Woo
  • 258,903
  • 69
  • 498
  • 492
1

your syntax is not correct please correct it

UPDATE tickets 
SET ticket_urgency = 'Urgent', 
    ticket_status = 'new'
 WHERE ticket_id='14'
Murali N
  • 3,451
  • 4
  • 27
  • 38