This is the query I use
const dbQuery = INSERT INTO tasks (activity, type, participants, price, link, key, accessibility) VALUES ('${activity}','${type}','${participants}' ,'${price}','${link}','${key}','${accessibility}')
;
This is the error I receive: "There is an error in your SQL syntax; check the manual for your MySQL server version for use near 'key,accessibility) VALUES ('Repaint a room in your house','recreational','1' Correct syntax) ,'0.' on line 1"
The received key value is similar to "4877086"
I thought it was a data type issue in sql so tried using bigint, varchar and int but still got the same error. Also tried converting the key to a number. If I remove the key from the grammar I receive the result perfectly. (Using Tableplus for MySql)
The word "key" is a reserved keyword in MySQL.
Avoid using it as a column name.
If you must use it, you can enclose it in backticks (`) to indicate that it is a column name and not a keyword.
Check if this is the cause of your problem.