Вот код:
application.post('/Modification/SaveEdit/:idd',function(req,res){
var mem = req.body.memo;
connection.query('UPDATE memos SET textMemo = ?',mem,'WHERE idMemo = ?',req.params.idd, function (error, results, fields){
if (error) {
console.log("error ocurred",error);
res.send({
"code":400,
"failed":"erreur survenue"
})
}else{
console.log('Resultats: ', results);
res.send({
"code":200,
"success":"votre memo est bien modifié ! "
});
}
});
});
Я думаю, что это синтаксис моего запроса, но я не знаю, как правильно его написать.
Вот ошибка:
TypeError: argument callback must be a function when provided
at Function.createQuery (/home/mohand/node_modules/mysql/lib/Connection.js:57:13)
at Connection.query (/home/mohand/node_modules/mysql/lib/Connection.js:181:26)
at /home/mohand/TpsWEB/DMajour/expreServer.js:146:13
at Layer.handle [as handle_request] (/home/mohand/node_modules/express/lib/router/layer.js:95:5)
at next (/home/mohand/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/mohand/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/mohand/node_modules/express/lib/router/layer.js:95:5)
at /home/mohand/node_modules/express/lib/router/index.js:281:22
at param (/home/mohand/node_modules/express/lib/router/index.js:354:14)
at param (/home/mohand/node_modules/express/lib/router/index.js:365:14)
Спасибо заранее!