INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

HANDLE


PASSWORD
Remember Me
Forgot Password?

Come Join Us!

  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • Turn Off Ad Banners
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

E-mail*
Handle

Password
Verify P'word
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Member Feedback

"...I have tons of books, have book marked tons of tutorials, which have helped, but this forum has answered those "impossible to find" solutions. I am thrilled with this site..."

Geography

Where in the world do Tek-Tips members come from?

MySQL AB: MySQL FAQ

Common Operations

PHPDIG Monthly Stats
Posted: 17 Apr 07

I've recently Installed PHPDIG on my web server. It uses a MySql database to collect the information. The current release only gives its stats as total results. I am interested in seeing what people are looking at on my site, over time, so I can drive the information I provide them. So I developed this query to give me a quick and easy monthly snapshot of search terms:

CODE


SELECT l_includes, count(l_includes) as l_count
FROM logs
WHERE l_ts >= '2007-04-17'
AND l_ts <= '2007-04-30'
AND l_includes != ""
group by l_includes
order by l_count desc

The query will return a list of search terms ranked by the number of times that term was used for the dates entered in the query:

Quote (PHPMyAdmin):


l_includes              l_count
escrow                  3
job postings            2
investment rules        1
job posting             1
real estate             1

I've saved this query to my monthly task list in Outlook. When the reminder comes up I copy the query, change the dates and execute.

Back to MySQL AB: MySQL FAQ Index
Back to MySQL AB: MySQL Forum
My FAQ Archive
Email This FAQ To A Friend

My Archive