Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Attempting to insert data into a column

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

I’m attempting to run a query to insert into the table:

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

The error i get is:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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’m doing wrong? According to the documentation on queries my query is correct. I’m obviously missing something.

>Solution :

key is a reserved word, you must delimit it:

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

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading