= ".prepare($date_start).' AND data <= '.prepare($date_end).') AND dir = '.prepare($dir).' '.$add_where.' GROUP BY periodo ORDER BY data ASC'; $raggruppamenti = $dbo->fetchArray($query);