Relative Content

Tag Archive for javascriptsqlmysqlexpress

How do I insert a table name into a mysql query with ExpressJs? [duplicate]

This question already has answers here: Nodejs-Mysql Query table name as a variable (2 answers) Closed last month. I’m trying to use this to get contents of a specific table: let tablename = req.body.login connection.query(‘SELECT * FROM ?’, tablename, (err, rows) => { if (err) throw err res.send(rows) }) But due to tablename being a […]