When I run my code and it returns {"pass": "123"}. how to get "123" please help me
app.post("/",urlencodedParser,function(req,res){
pool.connect(function(err,client,done){
client.query("select password from account where user='"+req.body.textUser+"'",function(err,result){
var password = result.rows[0];
res.send(password);
});
});
});
Adépòjù Olúwáségun
3,6211 gold badge22 silver badges27 bronze badges
1 Answer 1
password is a dictionary so if you want just the value of pass then you can do this: res.send(password.pass);
Sign up to request clarification or add additional context in comments.
Comments
lang-js