I am trying to save a result of a query into a variable, I have read that you have to use a callback to do this. I am having problems with this process and receiving an error.
function getQryUser(user) {
if (user.chkUserStatus) {
var qryUser = request.query("SELECT someItems on someTbls", function(err, rows, done) {
if (err) {
return done(err, null);
} else {
return done(null, rows[0]);
}
});
}
}
and from where I am calling my function
var qryUser = getQryUser(user);