Pezmc Posted December 1, 2006 Share Posted December 1, 2006 i have been working on a advanced website stats page ([url=http://www.shogans.com/stats/shogansstats.php]http://www.shogans.com/stats/shogansstats.php[/url]), however when it has got to the more advanced mysql queries i am stumped.Here is my database structure[code]id browser ip recieved refer user1 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.221 2006-11-29 http://www.shogans.com/index.php?do=fight 2 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.222 2006-11-30 http://www.shogans.com/index.php 3 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.223 2006-11-30 http://www.shogans.com/index.php 4 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.224 2006-11-30 http://www.google.co.uk/search?hl=en&safe=off&clie... 5 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.224 2006-12-01 http://www.shogans.com/index.php 6 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.224 2006-12-01 http://www.shogans.com/index.php 7 Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98) 193.205.147.22 2006-12-01 None 8 Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98) 193.205.147.22 2006-12-01 None 9 Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98) 193.205.147.22 2006-12-01 None 10 Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98) 193.205.147.22 2006-12-01 None 11 Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98) 193.205.147.22 2006-12-01 None 12 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.225 2006-12-01 http://www.shogans.com/index.php 13 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.228 2006-12-01 http://www.shogans.com/index.php 14 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.229 2006-12-01 http://www.shogans.com/index.php 15 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.230 2006-12-01 http://www.shogans.com/index.php 16 209.172.38.156 2006-12-01 None 17 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.220 2006-12-01 None 18 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;... 87.113.14.220 2006-12-01 None 19 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1;... 87.113.14.220 2006-12-01 http://www.google.co.uk/ig 20 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv... 87.113.14.220 2006-12-01 None [/code]Now I am trying to work out these things from that database. Anyone that helps me will get a link to their site on the thanks page (I'm a nice guy ;D)The things I dont understand how to get from that are:RecordUnique Hits: Would like a result like 19 - 01 October 2006Page Views: Would like a result like 19 - 01 October 2006as well asUnque hitsThis Week: 85This Month: 264andPageviewsThis Week: Would like a result like 85This Month: Would like a result like 264Please help me get these results I have allready got by myself everything at http://www.shogans.com/stats/shogansstats.php Link to comment https://forums.phpfreaks.com/topic/29157-solved-advanced-website-statistics/ Share on other sites More sharing options...
Pezmc Posted December 2, 2006 Author Share Posted December 2, 2006 Someone has to know how to get these Link to comment https://forums.phpfreaks.com/topic/29157-solved-advanced-website-statistics/#findComment-133922 Share on other sites More sharing options...
artacus Posted December 2, 2006 Share Posted December 2, 2006 I don't see the name of your date/time field. If it is all part of your "user" field, you'll need to break that apart first.Something like this should work:[code]SELECT DATE(name_of_timestamp) AS the_day, COUNT(DISTINCT(user)) AS num_usersFROM tableGROUP BY DATE(name_of_timestamp)[/code] Link to comment https://forums.phpfreaks.com/topic/29157-solved-advanced-website-statistics/#findComment-134059 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.