So I'm using MySQL2 which is an npm package that allows you to connect to mysql databases.
Basically, I'm trying to add something to the database, however the information which it inputs are stored in a variable. Now, since the way you insert things into the database matters, you have to use specific quotes, so either single quotes, double quotes or backticks. We all know that if you want to put a variable in a string you would do `${varName}`, however, since the query has to be in a string that's made up of single quotes, you can't access that variable. What can I do here? How can I access the variable?
Before you say "replace single quotes with backticks", I tried this and this is the error I get,
const sql = `INSERT INTO test_strikes (username, strike_reason, responsible_instructor) VALUES (${guardNickname}, ${strikeReason}, ${responsibleInstructor})`;
All of those have their own variables defined as strings of letters, and this is the error I get when that's triggered.