[求助]我的sql语句失效,不论什么表单都能通过验证。

我用的nodejs,想做一个登陆注册。

app.get('/login', function (req, res) {
    var name = req.query.name;
    var pwd = md5(req.query.pwd);
    var selectSQL = "select * from cust where name = '" + name + "' and pass = '" + pwd + "'";
    connection.query(selectSQL, function (err, rs) {
        if (err) throw err;
        console.log('登陆成功');
        res.sendFile(__dirname + "/" + "OK.html");
    })
})

这一段的时候,无论提交的表单在对应的MySQL中有没有,他都会通过验证。请教大佬们这个应该怎么解决。对应的MySQL库中只有两条数据。

Just console.log(rs) and you'll find it yourself.