0

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);
            });
        });
    });

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.