Usage:
1- Import 'visits.sql' in your DB using "phpmyadmin".
2- Include/Require 'visits.php' once in any script you want to use this class in.
3- List of functions:
A) Count
Increments the count of today visits (creates a record for today if not found). If not called, the number of today visits will not be increased and you can use the rest of functions to collect the stats.
B) GetAll
Returns total visits.
C) GetLastDays
Returns sum of the visits of previous days (number of days is the parameter).
D) GetLastDay
Returns the exact visits of the specified day ago (difference of day is the parameter).
E) GetToday
Works like GetLastDays(0) and GetLastDay(0) and returns today visits (Just added for convenience).
Hopes to be useful. |