Posto anche il codice se magari qualcuno riesce a capire perchè non va mi fa un favore enorme
Codice PHP:
$query = mysql_query("select data,extract(year_month from data) as mese_anno
from commenti group by mese_anno
order by data desc") or die(mysql_error() );
$str = ' ';
while ($row = mysql_fetch_assoc($query) ) {
$mese_anno = $row['mese_anno'];
$str.= "<a href=\"index.php?data=$mese_anno\">".date('d M y - H:i',$row['data'])."</a>
\n";
}
nel caso possa essere un problema di DB vi scrivo anche la struttura della tabella.
nella tabella articolo contiene:
-id_articolo (int(5))
-titolo (varchar(100))
-data (int(11))
-testo (text)