I am trying to query results from my MEMSQL database, and have been unsuccessful.
Once the application starts i get an error stating" The solution is undefined" , followed by the
results i’m trying to query.
The results show up in the console log, but not in the actual application.
Ive attached a copy of my code below:
connection.connect(function(err){
if (err) throw err
});
function getTeams(callback){
var results = connection.query(‘SELECT ID, NAME FROM TEAM’,function(err, results, fields){
if (err) throw err
//console.log(results);
console.log('The solution is: ', results[0].solution);
return callback(results);
});
}
Your help will be greatly appreciated.