Reputation: 3
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);
});
});
});
Upvotes: 0
Views: 699
Reputation: 762
password
is a dictionary so if you want just the value of pass then you can do this: res.send(password.pass);
Upvotes: 1