统计过去数据一个php脚本



    
 
  
 
  =30){
$date = date('Y-m-d', strtotime("-". $i." day"));
//echo $date;
$sql =  "select count(*) as ant from  adm_sys_op_log  where last_changed_date like '%s%%'";
$sql=sprintf($sql,$date);
//echo $sql."\n";
$rs = mysql_query($sql, $con);




    $row = mysql_fetch_array($rs);
    $product_id = $row['ant'];
    echo $date." ".$product_id."\n";
$i--;
}
mysql_close($con);
exit;

var_dump(strtotime($date)>strtotime('2013-09-3'));exit;
  $sql =  "select count(*) as ant from  adm_sys_op_log  where last_changed_date like '%s%%'";
$sql=sprintf($sql,$time);
var_dump($sql);exit;
  $rs = mysql_query($sql, $con);




    $row = mysql_fetch_array($rs);
    $product_id = $row['ant'];
  var_dump($product_id);


  mysql_close($con);
?>

你可能感兴趣的:(统计过去数据一个php脚本)