Good, I have this query that I do with my API REST in NodeJS
router.get("/create/:id/:name/:img",function(req,res){
var query = "INSERT INTO ??, (??, ??, ??) VALUES (?, ?, ?)";
var table = ["demos", "id", "name", "img", req.params.id, req.params.name, req.params.img];
query = mysql.format(query,table);
connection.query(query,function(err,rows){
if(err) {
res.json(err);
} else {
res.json(rows);
}
});
});
And the problem is that it returns this error to me
{"code":"ER_PARSE_ERROR","errno":1064,"sqlState":"42000","index":0}
I can not find the problem, but ... sure one has a solution hehe, greetings.