Strange WCDDL v2 Stats Issue?

Status
Not open for further replies.

DEViANCE

Active Member
1,399
2009
64
0
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>";
}
 
9 comments
On your site where should it say over 100? I see 75 and 72.

Users Online: 4
Total Unique Hits: 75
Unique Hits Today: 72
Total Hits: 127
Hits Today: 117
Average: 59.1%
Downloads: 10
Queue: 0
 
Its not meant to say 100 anywhere, just each time i use the mod when it reaches around 100 hits, in this case 127, it freezes and stops inserting data (i assume).

It gives no error, just stops moving like it has now.
 
It should be? I just used a proxy myself on it??

Yes it is the v2 acidtech smoky posted earlier, i changed tiny bits but not much. Its far from finished yet. I will buy a proper domain for it when its to a decent level.
 
Status
Not open for further replies.
Back
Top