I am writing this function with node.js, inside the function it gives me the right output, but when I try to call it from the outside it gives me undefined. Do you have some idea why it doesn't work?
var inquinamento=function(){
connection.query('select livelloInquinamento from livInquinamento;',function(err,rows,fields){
console.log(rows);
return rows.livelloInquinamento;
});
}