0

このクエリを実行すると、エラーが発生してテーブルが更新されます。

 client.query('UPDATE Campaign SET ( Name, StartDate ) VALUES ( "' +req.body.Name+ '" , "' +req.body.StartDate+ '" ) WHERE idCampaign = ' +id , function(err, result) {
    if(err) {
        console.log("err found" + err);
    }
    else{
        console.log(result);
        res.send(result[0])
    }

});

 ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '( Name, StartDate ) VALUES ( "" , "" ) WHERE idCampaign = 89126b2d-c906-11e2-9cf'

エラーがどこにあるのかわかりません

4

2 に答える 2