I have a mysql query executed from NodeJS using mysql npm package.
Upon success, I want to read the value in Javascript.
Both are on the same domain.
On console.log
the value I read is 3
.
How can I retrieve the data object values?
var mysql = require('mysql');
var connection = mysql.createConnection(connectionOptions);
connection.query(
"SELECT * FROM pruebas.Usuarios2 where RFC = '123'",
(err, result, fields) => {
if (result.length) {
// here I need an instruction that can send me the result of 3
// to my javascript console
} else {
console.log('no login');
}
}
);