0
UPDATE accounts 
SET lastSerialChange = CURRENT_TIMESTAMP 
WHERE username = 'Jayden';

UPDATE accounts 
SET serialChanges = '[{"serial":"D06ACE5BBE90E803590D1691FB9254B3","reason":"test","date":1695495618004}]' 
WHERE username = 'Jayden';

INSERT INTO serial_requests 
(username, serial, reason, requestedAt) 
VALUES  ('Jayden',
'D06ACE5BBE90E803590D1691FB9254B3',
'test',
1695495618004);

I am querying my database with the above, I believe correct syntax, but I get an error saying:

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 'UPDATE accounts SET serialChanges = '[{"serial":"D06ACE5BBE90E803590D1691FB9254B' at line 2

I have been trying to debug this for a long time but I just can't identify what the problem is with my syntax.

4
  • 1
    Step 1) Run each one alone to find the problem one. en.wikipedia.org/wiki/Divide-and-conquer_algorithm Commented Sep 23, 2023 at 19:12
  • There may a non-printable character just before the 2nd update statement causing the syntax error. Commented Sep 23, 2023 at 19:51
  • You didn't say which application language you're using, but the answer is the same regardless. Most MySQL programmatic interfaces support a single query per call. There is a way to enable multi-query, but almost no good reason to do so. Commented Sep 23, 2023 at 21:03
  • Yep, that was the problem! Commented Sep 23, 2023 at 23:52

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.