Hi Guys,
I have a hit counter built in to my website so I can keep statistics on traffic coming to certain pages. The service works similar to bit.ly
I am trying to compile some stats about the http_referer collected when a hit is counted. If you go to the following link, and click the 'referer' tab under stats, you can see how the host/string and respective hits are calcuated.
http://bit.ly/cGXNq3+
Here is an example referer and below it is how I split it up for collection in the database
http://forums.devshed.com/coldfusion-development-84/
referer_host - forums.devshed.com
referer_string - coldfusion-development-84/
Here is the table structure for the hit records
tbl_hits
hit_id
redirect_id
hit_datetime
referer_host
referer_string
referer_type
location
ip
Want to group referer_string hit results according to the referer_host they belong to..
example; 4 hits come in from 3 different referers
1 http://forums.devshed.com/coldfusion-development-84/
2 http://forums.devshed.com/php-development-5/
3 http://forums.devshed.com/java-help-9/
4 http://forums.devshed.com/php-development-5/
This would result in
forums.devshed.com - 4 hits (total)
-coldfusion-development-84/ - 1 hit
-php-development-5/ - 2 hits
-java-help-9/ - 1 hit
1. Need total hits where 'id' = id and referer_host = referer_host
2. Need total hits where 'id' = id and referer_host = referer_host and referer_string = referer_string
I'm not sure if I can compile this data with just one query. If anybody has any ideas on how to write this out, I'd be very grateful. I'm trying to figure it out on my own but a query like this is just over my head at this time.
I have a hit counter built in to my website so I can keep statistics on traffic coming to certain pages. The service works similar to bit.ly
I am trying to compile some stats about the http_referer collected when a hit is counted. If you go to the following link, and click the 'referer' tab under stats, you can see how the host/string and respective hits are calcuated.
http://bit.ly/cGXNq3+
Here is an example referer and below it is how I split it up for collection in the database
http://forums.devshed.com/coldfusion-development-84/
referer_host - forums.devshed.com
referer_string - coldfusion-development-84/
Here is the table structure for the hit records
tbl_hits
hit_id
redirect_id
hit_datetime
referer_host
referer_string
referer_type
location
ip
Want to group referer_string hit results according to the referer_host they belong to..
example; 4 hits come in from 3 different referers
1 http://forums.devshed.com/coldfusion-development-84/
2 http://forums.devshed.com/php-development-5/
3 http://forums.devshed.com/java-help-9/
4 http://forums.devshed.com/php-development-5/
This would result in
forums.devshed.com - 4 hits (total)
-coldfusion-development-84/ - 1 hit
-php-development-5/ - 2 hits
-java-help-9/ - 1 hit
1. Need total hits where 'id' = id and referer_host = referer_host
2. Need total hits where 'id' = id and referer_host = referer_host and referer_string = referer_string
I'm not sure if I can compile this data with just one query. If anybody has any ideas on how to write this out, I'd be very grateful. I'm trying to figure it out on my own but a query like this is just over my head at this time.