I am fetching results from a query and want to pass value from result on the next query. Here is my code. But it's not working, I tried setTimeOut function as well. 
dbcon.query('SELECT ci_offers.*, ci_advertisers.id as merchant_id, ci_advertisers.full_name, ci_advertisers.phone, ci_advertisers.companylogo FROM ci_offers, ci_advertisers WHERE ci_offers.advertiser_id = ci_advertisers.id AND ci_offers.is_active=1', function(error, results, fields) {
      if (error) throw error;
      if (results.length > 0) {
            var objectOffer;
            var objCoin;
            // async.forEachOf(results, function (dataElement, i, inner_callback){
            results.forEach((val) => {
                objectOffer = jsonParser(val);
                var token_id = objectOffer.token_id;
                var redeem_coin_grabbed = 0;
                if (token_id > 0) {
                  dbcon.query('SELECT count(id) as coingrabbed FROM ci_grabcoin_details_for_game WHERE user_id = ? AND coin_id= 33', [user_id, token_id], function(error1, results1, fields1) {
                    if (error1) throw error1;
                    });
                }
                val["coingrabbed"] = redeem_coin_grabbed;
                final.push(val);
            });
        }
        res.send(final);
    });
 
     
    