tags:

views:

235

answers:

3

I'm having a bear of a time getting the mailchimp api to cough up info. In their example I'm fine (the first is an abridged version of theirs.) How come when the method changes I can't get the array to show the collected information?

why is this valid: (it's taken from here http://www.mailchimp.com/api/rtfm/campaignemailstatsaimall.func.php, i just removed some of the iterative data)

$limit = 5;
for($i=0;$i<5;$i++){
    $allstats = $acct->campaignEmailStatsAIMAll($campaignId, $i*$limit, $limit);
    foreach($allstats as $email=>$stats){
        echo "[".$email."]\n";
  }
}

and this not: (this is the function listed here: http://www.mailchimp.com/api/rtfm/campaignopenedaim.func.php)

$limit = 5;
for($i=0;$i<5;$i++){
    $allstats = $acct->campaignOpenedAIM($campaignId, $i*$limit, $limit);
    foreach ($allstats as $email => $stats) { 
       echo $stats; 
    }

   }

Most importantly, as my attempt has failed, how would you write the second method (campaignOpenAIM) to iterate through the data in the captured array?

UPDATE: it would appear that the array is empty. --- but why is it empty when the parameters haven't changed?

A: 

are you sure that your results ($allstats) is not empty?

SilentGhost
A: 

Mailchimp customer support has been outstanding for me. Have you tried them here?

GregD
i just fired off an email to them ... good thought.
A: 

that must be it...

the result is an invalid argument... must be empty. ARGHH!

thx. not sure why it's empty however....