I have a problem on my program on node.js, I want to return the result of a mysql request here is the code. Please help me
var pays = require("../entity/pays");
var bd = require('../config/bd');
var connection = bd.connection();
var PaysDao = function PaysDao() {
}
PaysDao.prototype.getAll = function() {
var pays;
var query = connection.query('SELECT * FROM pays ORDER BY nomPays', function (error, results, fields) {
if (error) throw error;
pays = results;
});
return pays;
}
exports.PaysDao = PaysDao;