C'est pas optimisé, mais ça répond à ton problème :
$query = "SELECT COUNT(id) as compt,nom FROM test3 GROUP BY nom";
$result = mysql_db_query ($cfgBase,$query) or die ("Erreur 1" );
while($row = mysql_fetch_object($result))
{
$compteur[$row->nom] = $row->compt;
}
$query2 = "SELECT id,nom,date FROM test3 ORDER BY nom";
$result2 = mysql_db_query ($cfgBase,$query2) or die ("Erreur 2" );
$i = 0;
while($row2 = mysql_fetch_object($result2))
{
$nom[$i] = $row2->nom;
if($nom[$i]!=$nom[$i-1])
{
echo '<br>'.$nom[$i].' - '.$compteur[$nom[$i]].' - '.$row2->date;
}
else
{
echo ' - '.$row2->date;
}
$i++;
}
Sans les dates :
$query = "SELECT COUNT(id) as compt,nom FROM test3 GROUP BY nom";
$result = mysql_db_query ($cfgBase,$query) or die ("Erreur 1" );
while($row = mysql_fetch_object($result))
{
echo $row->nom." - ".$row->compt."<br>";
}