0) { foreach ($courses as $course) { $course_id = $course['id']; break; } echo "-- Course ".$course_id."\n"; // Get attendances sheets from course (only one in each course) $att = $a->get_attendances_list($course_id,$session['id']); if (count($att)>0) { foreach ($att as $at) { $at_id = $at['id']; break; //get out after first result } echo "---- Attendance ".$at_id."\n"; $a->set_course_int_id($course_id); $a->update_users_results($u,$at_id); } else { var_dump($att); } } if ($session['id']>$max) { die('Finished processing '.$max."\n"); } }