php - Limit visitors statistics to 30 days -


i trying edit great visitor statistics script (php/mysql) ghaffar khan (full script @ http://www.codeproject.com/articles/35570/site-statistics-with-php-and-mysql) having hard time trying limit visitors shown in graph stats past 30 days. there unfortunately no instruction on how , i've been struggling far. here main script:

<?php  include("configuration.php");  $page = input($_get['page']) or die('error: missing page id');      mysql_select_db($database, $con);  // total visits count $query='select count( * ) total  '.$tablename.' section=\''.$page.'\''; $result = mysql_query($query); $row = mysql_fetch_array($result, mysql_num); $count = $row[0];   // unique visitors count $query='select  count(distinct ip) '.$tablename.' section=\''.$page.'\''; $result = mysql_query($query); $row = mysql_fetch_array($result, mysql_num); $uniaqucount = $row[0]; mysql_close($con);  /* graph rendering script goes here */  ?> 

my best guess add line count visits if date (contained within sql field "date") within past 30 days. not being talented php developer myself (more of graphic/design person here), sincerely appreciate guys provide.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -