我在Node中使用'mysql'库
这是我使用而不是准备好的声明,并且工作得很好:
connection.query("update table set col1=? where col2=1",[val1],function(err,rows){
//connection.release();
if(!err) {
//further code
}
});
Run Code Online (Sandbox Code Playgroud)
但是,这不适用于2个unkowns:
connection.query("update table set col1=? where col2=?",[val1],[val2],function(err,rows){
//connection.release();
if(!err) {
//further code
}
});
Run Code Online (Sandbox Code Playgroud)
错误消息显示"undefined不是函数".我究竟做错了什么?