foreach() help

Hello,

I can’t seem to figure this out. I mean it should work. Any help you could give would be very much appreciated.

I am getting the following errors on my webpage

Warning: Invalid argument supplied for foreach() in /home/patcheen/public_html/booking/includes/classes/Order.php on line 231
Warning: Invalid argument supplied for foreach() in /home/patcheen/public_html/booking/includes/classes/Order.php on line 235

The code it refers to is this

 foreach($event_stat as $event_id=>$count){
   if(!Event_stat::dec($event_id,$count)){return FALSE;}
 }
 
 foreach($category_stat as $cat_id=>$count){
   if(!Category_stat::dec($cat_id,$count)){return FALSE;}
  }

and here is where $event_stat and $category_stat are declared and populated

   $event_stat[$ticket->event_id]++;
    $category_stat[$ticket->category_id]++;

Any ideas? Have I given enough information? Thank you so much for taking the time to look over this. I’m not going anywhere until this is resolved. So if you need more info please let me know. Thanks again.

Pat

can’t see any errors in that part.

are u using error_reporting(E_ALL)? maybe there was an other error earlyer.

what du u get when u use print_r($event_stat)/print_r($category_stat) right in front of the foreach loops?

Sponsor our Newsletter | Privacy Policy | Terms of Service