while ($line = mysql_fetch_array($result_last, MYSQL_ASSOC)) {
if ($date_last <> $line["date"]) {
$data_temp = $line["date"];
$query_totals = "SELECT count(cover_code) as totale FROM `covers` WHERE date = '$data_temp' and (active=1 or active_mirror=1) ;";
$result_totals = mysql_query($query_totals) or die("Query failed");
$totals = mysql_fetch_array($result_totals, MYSQL_ASSOC);
print ("