This is the code I am working on:
var nbu = req.body.nbu;
var inv=[];
db.query(
"SELECT * FROM `invoice_ska` WHERE nm_client =?",
nbu,
(err, results) => {
if (err) throw err;
inv.push(results);
}
);
console.log(inv);//this just []
});
I am facing an issue where I cannot console.log(myArr) and I am not sure why.