Total hits: $t

Unique hits: $u

"; print "

Hits for past 31 days (per day)

"; for($time = strtotime('now'); $time > strtotime('-1 month'); $time = strtotime('-1 day', $time)) { $date = strftime('%Y-%m-%d', $time); $thisday = $date; //$nextday = strftime('%Y%m%d000000', strtotime('+1 day', $time)); $uhits[$date] = mysql_query("select comic as comic, count(distinct ip) as uc, count(ip) as cc from hits where date like '$thisday %' group by comic", $db) or die(mysql_error()); while($row = mysql_fetch_assoc($uhits[$date])) { $uniques[$date][substr($row['comic'], 0, 10)] = $row['uc']; $total[$date][substr($row['comic'], 0, 10)] = substr($row['cc'], 0, 8); } print ""; print ""; print ""; print ""; print ""; print ""; print ""; if(isset($uniques[$date])) { foreach($uniques[$date] as $comic => $count) { $tcount = $total[$date][$comic]; print ""; } } print "
Date: $date
ComicUniquesTotal
$comic$count$tcount

"; } ?>