PHPBuilder - Revisited: Logging With PHP Page 3



RSS Twitter
Articles Site Operation

Revisited: Logging With PHP - Page 3

by: Tim Perdue
|
December 10, 2000

REPORTING
Reporting all this information is easy with PHP - just write up some SQL, execute it and use the ShowResults() function (included below) to display it. You can also graph it using the Graphing Lib that I mentioned in a prior article.
So now the system is in place and I can run a report at any time and get statistics up to the minute for any given site.

Sample SQL to run reports

Page Views By Day
SELECT day, count(*) 
FROM activity_log 
WHERE type=0 GROUP BY day
Page Views By Browser
SELECT browser, count(*) 
FROM activity_log  
WHERE type=0 GROUP BY browser
Page Views By Browser Version
SELECT browser, ver, count(*)
FROM activity_log
WHERE type=0 GROUP BY browser, ver
Page Views By Platform
SELECT platform, count(*)
FROM activity_log
WHERE type=0 GROUP BY platform
Overall, I'm pretty impressed with this system. There's really no limit to its flexibility.
Please use the sample code on the next page and tell me how you used it, or if you added anything interesting to it.

« Previous Page
1
|
2
|
3
|
4
|
5
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Tim Perdue

Comment:



Comment:

(Maximum characters: 1200). You have characters left.