prepare('select distinct date_trunc(\'day\', call_timestamp) as rdate from recordings order by rdate'); $sth->execute(); foreach ($sth->fetchAll() as $row) { echo '' . $row['rdate'] . ' '; } ?>