How to display the Mysql value out of the function in nodejs

Apr 18 2019 3:05 AM
I want to return a mysql value,and that value is stored in varible of out of the query
 
This is My code : 
 
if (intent.intent==='Sales-1'){
var rsp = con.query("SELECT Mobiles from Salestb", function (err,result, fields) {
if (err) throw err;
Object.keys(result).forEach(function(key) {
var row = result[key];
console.log(row.Mobiles);
});
});
response.output.text = "This is the modified Output :"+ rsp;
}
 
 But my output is [object Object] 
 
 
Actually I want to output like this : This is the modified Output : 123456(some vale) 

Answers (2)