Jump to content

Unique records for my stats


mrpaul

Recommended Posts

Hello

I'm new to this forum, so firstly, let me say hello to everyone. I am wondering if anyone here can help me? I am creating a simple stats page for one of my websites, I have a sql table which I capture the following;

PAGE URL
USER IP

The entire table structure is;

id
url
ip
date
time

Some sample data is

1    www.site.co.uk/index.php    76.376.112.236    2006-12-11    34-38-00 
2    www.site.co.uk/help.php    23.222.765.345    2006-12-11    41-38-00 3    www.site.co.uk/index.php    76.376.112.236    2006-12-11    54-39-00

Using just the above data, if I do a count on this table I get "3" returned, as there are 3 rows.

I want to put a part on my stats page which gives me the total number of unique visitors, I can do this by counting the total rows in the database and then counting any row which has the same `url` and `ip`, as one row, so on the above sample data, it would return "2", as row "1" and "2" have the same value in the fields URL and IP.

Can anyone help me out with solving this?

Regards

Paul

Link to comment
https://forums.phpfreaks.com/topic/31081-unique-records-for-my-stats/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.