Visitor counter issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
denisw
Forum Newbie
Posts: 14
Joined: Mon Jul 24, 2006 11:21 pm

Visitor counter issue

Post by denisw »

I would need some advice on how to manage visit counting using php & mysql.

Currently I'm using function "microtime()" to get the current time and store the value in FLOAT variable.
In mysql, the varible is stored as FLOAT UNSIGNED.

The problem is , I often get mysql error (duplicate key error). Logically microtime() is more than enough to get unique value for visit activity. Moreover I'm still testing it using single user account.

I'm wondering if there is more appropriate variable type to handle this issue.

thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Visit counting? That's usually done off of session IDs.
Post Reply