NODE JS错误:con.query(...)。则不是函数

时间:2018-08-16 14:52:11

标签: javascript mysql node.js

function liveFeed_update() {
  //var num_row = 0;
  var _scripPromise = new Promise(function(resolve, reject) {
    var query_01 = "SELECT count (*) as total  FROM livedata where 
    script_name = 'ABC'
    ";  
    con.query(query_01).then(function(response) {
        resolve(response);
        console.log(response); //end of resolve
      }) //end of then
      .catch(function(error) {
        reject(error);
        console.log(error);

      }) //end of catch
  });

  _scripPromise.then(function(message) {
      console.log(message);
    },
    function(err) {
      console.log(err);
    }
  );
}

请帮助我解决此错误。

我得到这个:

"TypeError: con.query(...).then is not a function"

0 个答案:

没有答案