Home  >  Q&A  >  body text

Try inserting data into a column

I have a table called design_designs The table contains 4 columns: id, key, value, nonceId

I'm trying to run a query to insert into a table:

INSERT INTO design_designs(key, value, nonceId)
VALUES ('test key', 'test value', 'test nonce');

The error I get is:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'key, value, nonceId)
VALUES ('test key', 'test value', 'test nonce')' at line 1

Any idea what I did wrong? According to the query documentation, my query is correct. I'm obviously missing something.

P粉302484366P粉302484366181 days ago337

reply all(1)I'll reply

  • P粉955063662

    P粉9550636622024-04-06 09:04:08

    key is a reserved word and must be separated:

    INSERT INTO design_designs(`key`, value, nonceId) VALUES...

    reply
    0
  • Cancelreply