Hi, i am using the below code on wcddl v2 to show some stats at bottom....

At first it appears to work great... then when it reaches around 100 hits the counters stop updating and stay the same nomatter who visits.

Can anyone tell me what is wrong with the below code?

Code: 
function stats(){
//TRACK STATS
$ip = $_SERVER['REMOTE_ADDR'];
$referer = $_SERVER['HTTP_REFERER'];
$time = time();
$date = date("M, d, Y");
$add_stats = mysql_query("INSERT INTO wcddl_stats(ip,referer,time,date) VALUES ('$ip', '$referer', '$time', '$date')");
//GET STATS FROM DB
$unique_hits_select = mysql_query("SELECT DISTINCT ip FROM wcddl_stats");
$unique_hits_nr = mysql_num_rows($unique_hits_select);
$unique_hits_today_select = mysql_query("SELECT DISTINCT ip FROM wcddl_stats WHERE date = '$date'");
$unique_hits_today_nr = mysql_num_rows($unique_hits_today_select);
$total_hits_select = mysql_query("SELECT * FROM wcddl_stats");
$total_hits_nr = mysql_num_rows($total_hits_select);
$total_hits_today_select = mysql_query("SELECT * FROM wcddl_stats WHERE date = '$date'");
$total_hits_today_nr = mysql_num_rows($total_hits_today_select); 
// STATS OUT
$average2 = $unique_hits_nr / $total_hits_nr * 100;
$average = round($average2,1);
echo "<li>Total Unique Hits: $unique_hits_nr</li><li>Unique Hits Today: $unique_hits_today_nr</li><li>Total Hits: $total_hits_nr
</li><li>Hits Today: $total_hits_today_nr</li><li>Average: $average%</li>";
}
DEViANCE Reviewed by DEViANCE on . Strange WCDDL v2 Stats Issue? Hi, i am using the below code on wcddl v2 to show some stats at bottom.... At first it appears to work great... then when it reaches around 100 hits the counters stop updating and stay the same nomatter who visits. Can anyone tell me what is wrong with the below code? function stats(){ //TRACK STATS $ip = $_SERVER; $referer = $_SERVER; Rating: 5