I am trying to output a list of all the items from a MYSQL table to the console while using Node JS however when trying to use the code it gives me the error thata Callback function is not available with promise clients (the database connection is a promise as it is SSH tunnelled back to our university) any help with this would be really useful!!
var database = require('./dbConfig');
database.then((con) => {
con.query('SELECT * FROM Pupils', (err, rows) => {
console.log(rows)
})
})
con.query('SELECT * FROM Pupils').then(result => console.log(result))con.query('SELECT * FROM Pupils').then(([result]) => console.log(result))