const getData = (sqlrequest, successCallback) => {
return new Promise(function (resolve, reject) {
db.query(`${sqlrequest}`, (err, result, fields) => {
if (err) reject(err);
if (result) resolve(result);
});
});
};
const userId = await getData(`SELECT userId FROM users WHERE name='${name}'`);
console.log(`userId: ${userId}`);
- console.log(`userId: ${userId}`);
+ console.log('userId:', userId);