I m using the node,express,mysql2 packages .When i m using console.log(rows) ,it is giving me following output:
[{\"userid\": \"test\",\"password\": \"test\"}] <
Try this (this is really basic):
connection.query('SELECT * from pass', function(err, rows) { res.json(rows); var user = rows[0].userid; var password= rows[0].password; });