angularjs - How to use select statement with where condition on node.js -


enter image description here> trying provide login credentials email , password using postgres database table.

postgres database tables. when records should send 200 status page.am getting error on query. kindly me out how use select condition. missing syntax.

     getuser : function(req, res) {             var pg = require('pg');             var constring = process.env.database_url || "postgres://test:test@localhost:5432/wallet";         var client = new pg.client(constring);             client.connect();               console.log(req.query.email_id);              console.log(req.query.user_password);             var query = client.query("select * pp_user_profile email_id ="+req.query.email_id+ "and" + "user_password=" +req.query.password);              query.on("end", function (result) {                           client.end();                 res.writehead(200, {'content-type': 'text/plain'});                 res.write('success');                 res.end();               });     }, 

try below syntax:

"select * pp_user_profile email_id  = '"+req.query.email_id+"' , user_password= '"+req.query.password+"'"; 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -