Insert form data into mysql database table using node.js and express implicitly? -


i tried below code inserts explicitly alternative when want insert dynamically.

when tried query able insert table

var post  = {id:'20', name: 'cool', password:'****'};         var = con.query('insert  fuck set ?', post, function(err, result) {            if (err) throw err;         else res.send('success');         }); 

but when directly inserting form values table table not getting updated

app.post('/getdata',function(req, res, next){         var txtname = req.body.name;         var ager = req.body.age;         var pwdd = req.body.pd;       var post  = {id:ager, name: txtname, password:pwdd };     var = con.query('insert  fuck set ?', post, function(err, result) {        if (err) throw err;     else res.send('success');     }); 


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -