JunkMale
04-10-2010, 04:50 AM
I am trying to work out how you make a time based query, for example...
SELECT * FROM `database`.`table` WHERE `user_agent` REGEXP 'Mozilla'Will return a list of useragents that are Mozilla based / compatible. (Which was handy as I now know that my friends site is visited by 30% MSIE browsers and 70% Mozilla browsers)
I wanted to run a query on the database to find out other information, the column 'time' uses the CURRENT_TIMESTAMP as its time format and I wanted to know what is the best way of making a query for finding site visits based on time of day.
I want to gather information on:-
visitors during in work hours 9am to 5pm Mon to Fri
visitors outside those hours including Sat & Sun.
Can anyone suggest a way of doing this using a REGEXP or does a better option exist?
SELECT * FROM `database`.`table` WHERE `user_agent` REGEXP 'Mozilla'Will return a list of useragents that are Mozilla based / compatible. (Which was handy as I now know that my friends site is visited by 30% MSIE browsers and 70% Mozilla browsers)
I wanted to run a query on the database to find out other information, the column 'time' uses the CURRENT_TIMESTAMP as its time format and I wanted to know what is the best way of making a query for finding site visits based on time of day.
I want to gather information on:-
visitors during in work hours 9am to 5pm Mon to Fri
visitors outside those hours including Sat & Sun.
Can anyone suggest a way of doing this using a REGEXP or does a better option exist?