Qualcuno mi spiega perchè:
for ($i=20;$i>0;$i--){
$GiornoPrec= "SELECT Data FROM ".$tbl." where Data= NOW() - INTERVAL '".(20-$i)."' DAY";
$query = mysql_query ($GiornoPrec) or die ("Errore nella esecuzione della query ".$GiornoPrec);
$row = mysql_fetch_array($query);
$datax[$i-1] = $row['0'];
echo "-> ".$datax[$i-1]."
";
}
Da come uscita:
-> 2004-06-12
-> 2004-06-11
-> 2004-06-10
-> 2004-06-09
-> 2004-06-08
-> 2004-06-07
-> 2004-06-06
-> 2004-06-05
-> 2004-06-04
-> 2004-06-03
-> 2004-06-02
-> 2004-06-01
->
->
->
->
->
->
->
->
????
I giorni non tornano indietro oltre l'inizio del mese... invece dovrebbe farlo...