I have a problem with my script im using. the if $addcount is not working. it continues to fire the insertMessage function when i dont want it to. Any ideas why?
if(($result->data != '') && ($result->data != null)) {
$wallCount = 0;
$addCount = 0;
foreach($result->data as $thread){
$wallCount++;
$fromId = $thread->from->id;
$message = $thread;
if($fromId == $user['Id']){
if($addCount < 100) {
insertMessage($user['Id'], $message, $user['Num']);
$addCount++;
sleep(1);
}
}
}
}