0

Here is the JSON:

[ RowDataPacket { name: 'Matt' } ]

I need to extract the value 'Matt' to then update a value in a database, but stupid me is having trouble figuring out how to extract it.

Just for context, the json comes from this request:

var currentName = 'SELECT name FROM users WHERE password="' + authPass + '"';
userDB.query(currentName, function (err, result, fields) {
    if (err) throw err;
    console.log(result)
});
Barmar
  • 741,623
  • 53
  • 500
  • 612
PrismaticDevs
  • 75
  • 2
  • 7

0 Answers0