Try this as your sql
emit the Fname1 and Passwor1 as variables;
app.post('/insert',function (req,res){
var Fname1=req.body.fname;
var Passwor1=req.body.pwd;
var sql= "insert into test(Fname,Passwor) values ('"+Fname1+"', '"+Passwor1+"')";
con.query(sql,function(err,rows){
if(err) throw err;
res.send("Value has been inserted");
})
})
Top comments (0)