isRegistered(bla-bla);
async function isRegistered(id) {
var sel_query = await new Promise( resolve => {
con.query('SELECT * FROM `users` WHERE `userid`= ?', id, function(error, results) {
if(err) console.error(err);
resolve(results);
});
}).then( result => {
return result;
};
if(sel_query.length != 0) {
console.log(1, sel_query);
} else {
console.log(0);
}
}