non ho ben capito, scusa
io estraggo i dati da mysql per crearmi un menu contenente solo i mesi che hanno delle notizie, con questo script

codice:
$flag2="";
$archive_all = mysql_query("SELECT data_news FROM news
 ORDER BY data_news ASC", $db_comm) or die(mysql_error()); 
 while($row_archive=mysql_fetch_array($archive_all))

{
$data2 = explode("-",$row_archive['data_news']); 
$Newdata2 = $data2[1]."-".$data2[0]; 
  if($Newdata2!=$flag2)
  {
$valore_mese = $data2[1];
echo"<a href=\"show.php&type=news&month=$data2[1]\">
$mesi[$valore_mese]-$data2[0]</a> \n"; }
  }
come potrei riadattare quello che tu mi hai appena detto?