Am trying to access the value of 'i' in the db query below but unfortunately, because the result of the query is one, am only getting the first value of the looping instead of getting the entire looping values. Any help. Thanks
for (var i = 0; i < 5; i++) {
db('student_balance').where({'student_number':student_number}).then(function(pfb_row){
for (var b = 0; b < pfb_row.length; b++) {
pfb_row[b];
}
console.log(i)
});
}