i am quiet new to java script and node js, i am trying to get a value from a MySQL DB, and the return value is [object Object] instead of a string. i didn't really found any answer online what is the problem. i hope someone here could help. the row value is [object Object] .
here is my function
exports.getAllIdInfo= function(dbConnection, tables ,id , callback){
var tableName= tables[i];
var tableVariable = tableName;
var myQuery = 'SELECT time, ' + tableVariable + ' FROM ' + tableName + ' WHERE id= ' + id;
var query = dbConnection.query(myQuery, function (err, row, result) {
console.log(query.sql);
if (err) {
console.log("getAllGoodIds error");
console.error(err);
return;
}
console.log("row is: " + row);
callback(row);
});
};