Does anyone know how to properly write a parameterized SQL Query in javascript?
I attempted it myself, but encountered an error.
I even tried another method, yet I'm still facing syntax errors.
let sql =
;select * from q_users where firstname=?,[${name}]
let sql =
;select * from q_users where firstname=?,${name}
let sql =`select * from q_users where firstname=?,${[name]}`;
db.query(sql)
.then((data)=>{
console.log(data);
});