.then(function (val) {
var roleId = roleArr.indexOf(val.role) + 1;
db.query(
'UPDATE employee SET role_id = ? WHERE first_name = ? AND last_name = ?;',
[roleId, val.firstname, val.lastName],
function (err) {
if (err) throw err;
console.table(val);
startPrompt();
}
);
});
This code comes from an inquirer statement. The roleID, val.firstname, and val.lastName are good variables because they are tested elsewhere in the program. The update statement is not updating though. I tried it with doublequotes around the where statement variables but that doesn't work. What am I doing wrong? The same statement works in a mysql shell.