小编use*_*779的帖子

在NodeJS中的准备好的查询中设置多个字段

我在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不是函数".我究竟做错了什么?

mysql prepared-statement node.js express

5
推荐指数
1
解决办法
3070
查看次数

标签 统计

express ×1

mysql ×1

node.js ×1

prepared-statement ×1