'无法读取未定义'nodeJS Mysql的属性'长度'

时间:2015-10-09 14:47:16

标签: mysql node.js express

无法执行此操作。当我单独执行查询时,我没有收到任何错误。

   app.post('/Fu',function(req,res,next){

    var username = req.body.uname;
    var pass = req.body.pwd;

     con.query(' SELECT name FROM fun WHERE name = "' +username+'" ; SELECT password FROM fun WHERE password = "' +pass+'" ',function(err, results,fields) {



       if (results.length > 0) {

           var w = results[0].password;

           var q = results[1].name;
           //console.log(q);
           console.log('Login was successful');
           } 

         else {
                console.log('Login was not successful');
            }

     });

     res.send("success1");

    });

有人可以帮我解决这个问题吗?提前谢谢。

0 个答案:

没有答案