I have a piece of code where I want to get the value of a variable from mysql database.
var PNOP;
connection.query('SELECT pnop FROM MASTER1', [PNOP], function(err, results) {
console.log(results);
});
The connection query is working fine but the var PNOP is not getting updated.
The log file is showing the following entry:
[ { pnop: 7915.2 } ]
The value that I need to set as PNOP is 7915.2 which is what is in the mysql database.
What should I do to get the variable value?