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