我想知道如何使用节点JS获得一个条件,其中mysql Select请求为NULL、空集或其中包含某些内容。
目前我有:
function checkKey(key, cb) {
var activated = "";
var sqlcheck = "SELECT activated from authentification where discord_key = ?";
console.log("in function");
DB.query(sqlcheck, [key], function (err, result) {
if (err) throw (err);
if (result[0] && result[0].activated) {
activated = result[0].activated;
console.log("filled key");
} else {
activated = false;
console.log("empty key");
}
cb(activatedkey(activated));
//return (activatedkey(activated));
})
}
这样,我只得到了空和Null或者其他东西。我正在寻找一种方法来获得空或NULL或其中的一些东西。
非常感谢您的帮助
https://stackoverflow.com/questions/54754432
复制相似问题