=? ORDER BY startDate LIMIT 10'; $results = PlanningEvent::staticQuery($query,array($myUser->login,time()),true); $days = array(); foreach ($results as $result) { $days[date('dmY',$result->startDate)][] = $result; } ?>