$campo){ $documenti = $dbo->fetchArray('SELECT '.$campo.' FROM '.$tabella.' GROUP BY '.$campo); foreach($documenti as $documento){ reorderRows($tabella, $campo, $documento); } }