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
  • 669,327
  • 51
  • 454
  • 560
PrismaticDevs
  • 45
  • 1
  • 5

0 Answers0