You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While Inserting into the table from DBeaver the query is running fine, but when i am trying to the run the same query from the mysqljs, its throwing the syntax error.
Query INSERT INTO CHECK1 (testField) VALUES ('{"keywords":["1/4 pounder\'s"]}')
JS Code mysql.query('INSERT INTO CHECK1 (testField) VALUES (?)', [JSON.stringify(data.params)]);
From what i am able to figure out is the its not able to escape the single quotes ('), and that is what is throwing the error.
Error Thrown UnhandledPromiseRejectionWarning: Error: ER_PARSE_ERROR: 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 's\"]}' at line 1