Im new to node JS, Im buidling a custom query system that should return information from the Mysql Database when the user type question in a natural language form.
For the DB Part I have the following code:
con.CustomQuery = function(SQL){
console.log("Custom Query");
con.query(SQL, function (err, result,fields) {
if (err) throw err;
console.log(result);
var res = JSON.parse(JSON.stringify(result));
return res;
});
}
The fields names and values are dynamic, how can I retrieve the names of the returned fields? How can I turn the result into a normal string ?
thanks