I am using mysql library in Node
This is what I use instead of a prepared statement and works great:
connection.query("update table set col1=? where col2=1",[val1],function(err,rows){
if(!err) {
}
});
However, this does not work for 2 unkowns:
connection.query("update table set col1=? where col2=?",[val1],[val2],function(err,rows){
if(!err) {
}
});
The error message says: "undefined is not a function." What am I doing wrong?
source
share