无法执行此操作。当我单独执行查询时,我没有收到任何错误。
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");
});
有人可以帮我解决这个问题吗?提前谢谢。