My goal is to retrieve the contents of a specific table using this code snippet:
let tableName = req.body.login
connection.query('SELECT * FROM ?', tableName, (err, rows) => {
if (err) throw err
res.send(rows)
})
However, as tableName is a string, it ends up being inserted into the query with quotes, leading to an error. If this approach isn't feasible, what database structure would allow me to add users and additional data to any chosen table?