This is a async.parallel method to display the shop information and their corresponding images:
function listshops(callback)
{
async.parallel([
myFirstFunction,
mySecondFunction,
], function (err,results) {
console.log(results);
});
function myFirstFunction(callback) {
client.connection.query('select * from shop',function(err,data1){
callback(null,data1);
});
}
function mySecondFunction(callback) {
client.connection.query('select * from image',function(err,data2){
callback(null,data2);
});
}
1)My tables=>shop and images: https://i.sstatic.net/F20MU.png
2)output getting for my code.But this is not the output i expected: https://i.sstatic.net/ltJpf.png
3)expected output: https://i.sstatic.net/xAmvu.png