Answer the question
In order to leave comments, you need to log in
How to add variable to MYSQL + express query?
Good afternoon!
Tell me please.
How to add a variable to a MYSQL query
var valProgrammNumber = req.body.programmNumber;
var valFullName = req.body.fullName;
var valCompany = req.body.company;
connection.query('INSERT INTO umodoc (programmNumber, fullName, company)
VALUES (valProgrammNumber, valFullName, valCompany)',
function(err, rows, fields) {
console.log(err);
});
connection.end();
});
Answer the question
In order to leave comments, you need to log in
connection.query('INSERT INTO umodoc (programmNumber, fullName, company) VALUES (?, ?, ?)', [valProgrammNumber, valFullName, valCompany]...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question