Go Back   Web Server Hosting Forum by BODHost > Support > MySQL Issues.
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-14-07, 10:48
BOD Member
 
Join Date: Nov 2005
Posts: 131
Default How to check number of Users that come online in a month via MySQL?

CREATE TABLE t1 (year YEAR(4), month INT(2) UNSIGNED ZEROFILL,
day INT(2) UNSIGNED ZEROFILL);
INSERT INTO t1 VALUES(2000,1,1),(2000,1,20),(2000,1,30),(2000,2,2 ),
(2000,2,23),(2000,2,23);

In order to differentiate how many different days in each month of visits take place, you can use the following query -

SELECT year,month,BIT_COUNT(BIT_OR(1<<day)) AS days FROM t1
GROUP BY year,month;

The query will automatically remove duplicate visits.
Reply With Quote
  #2 (permalink)  
Old 06-14-07, 12:26
BOD Member
 
Join Date: Nov 2005
Location: New Mexico
Posts: 273
Default

hmmm..i suppose this can be used as an alternative to Awstats through cPanel, but i am not sure if it can give even detailed information on visitors.
Reply With Quote
  #3 (permalink)  
Old 06-14-07, 12:53
BOD Member
 
Join Date: Mar 2006
Location: Scotland
Posts: 201
Default carl

Is this is the only way for checking the visitors who came online via My SQl in a day.
Reply With Quote
  #4 (permalink)  
Old 06-14-07, 13:34
BOD Member
 
Join Date: Nov 2005
Posts: 131
Default

MySQL functions are well-known, and i suppose christina might be right here in case of alternatives. :D
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 03:09.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.