Closed LuisPaGarcia closed 6 years ago
How i can prepare query statements previous the execution.
let entry = 'value_to_prepare'; mysql.createConnection({ host: process.env.HOST, user: process.env.USER, password: process.env.PASSWORD, database: process.env.DATABASE }).then(function (conn) { connection = conn; return connection.query(`SELEC * FROM table where field ='${entry}'`); }).then(function (rows) { callback(null, success({ rows }, 200)) }).catch((err) => { console.log(err); });
https://github.com/mysqljs/mysql#escaping-query-values
Great. Thanks a lot!
How i can prepare query statements previous the execution.