页面统计应该怎么做? 如果8天没有访问,然后是不是还要判断,如果(只是原理)date()-最后访问日期>7,昨天-----提前7天全部变成0,当天+1;如果<7。。是不是太麻烦了?如果我要调查的页面有几十张。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 呵呵.可以用update来做.前期可以把SQL写好,然后根据情况调用.不过应该还有再好些的设计. 请问如果要调查几十张页面的话,有没有什么好的法子?有人说COOKIE,请问用COOKIE怎么做? 表mCountid 自增idcCount 计数cPage 页面cDate 时间每次update的时候,先判断是否有该记录,没有:insert into mCount(cCount,cPage,cDate) values(1,'页面',curDate())有,得到id:update mCount set cCount=cCount+1 where id=$idmysql为例,如果要求是某页,则后面加上 and cPage='页面'当天:where cDate=CURDATE()当月:where MONTH(cDate)=MONTH(CURDATE())昨天:where cDate=CURDATE()-17天内:where cDate>CURDATE()-7如果要必须是有记录的,则按cDate排序,取前几天记录,sum(cCount) 表mCountid 自增idcCount 计数cPage 页面cDate 时间每次update的时候,先判断是否有该记录,没有:insert into mCount(cCount,cPage,cDate) values(1,'页面',curDate())有,得到id:update mCount set cCount=cCount+1 where id=$idmysql为例,如果要求是某页,则后面加上 and cPage='页面'当天:where cDate=CURDATE()当月:where MONTH(cDate)=MONTH(CURDATE())昨天:where cDate=CURDATE()-17天内:where cDate>CURDATE()-7如果要必须是有记录的,则按cDate排序,取前几天记录,sum(cCount) 表mCountid 自增idcCount 计数cPage 页面cDate 时间每次update的时候,先判断是否有该记录,没有:insert into mCount(cCount,cPage,cDate) values(1,'页面',curDate())有,得到id:update mCount set cCount=cCount+1 where id=$idmysql为例,如果要求是某页,则后面加上 and cPage='页面'当天:where cDate=CURDATE()当月:where MONTH(cDate)=MONTH(CURDATE())昨天:where cDate=CURDATE()-17天内:where cDate>CURDATE()-7如果要必须是有记录的,则按cDate排序,取前几天记录,sum(cCount) to qiushuiwuhen(秋水无恨) 你的方法不错,我觉得应该想秋水无恨学习。 qiushuiwuhen(秋水无恨) 你的方法不错,谢谢! 我还有个问题:请帮帮忙我的显示统计页面的时候,假如有以下几个内容:总访问量:今日访问量:当月访问量:a 页面访问量:B页面访问量:C页面访问量:……我写QUERY是不是要写很多查询语句然后mysql_query?如果记录多的话是不是很慢? html中DIV的ID赋值 如何做 回复引用功能?? 网站开通!散分 Linux 下mkdir() 函数出现问题! 请问饮用文件路径的问题 Php中如何调用xml的dom php+msyql : Undefined offset: 2 php调用本地php文件问题 Can you help me? 下面这个循环应该怎么写才正确?我改的头晕了~~~~~ 怎样在php中获取Visual Foxpro 6 中的备注类型字段的内容。 请教关于设置phpmyadmin的密码问题,高分请教!!
不过应该还有再好些的设计.
id 自增id
cCount 计数
cPage 页面
cDate 时间每次update的时候,先判断是否有该记录,
没有:
insert into mCount(cCount,cPage,cDate) values(1,'页面',curDate())
有,得到id:
update mCount set cCount=cCount+1 where id=$idmysql为例,如果要求是某页,则后面加上 and cPage='页面'
当天:where cDate=CURDATE()
当月:where MONTH(cDate)=MONTH(CURDATE())
昨天:where cDate=CURDATE()-1
7天内:where cDate>CURDATE()-7如果要必须是有记录的,则按cDate排序,取前几天记录,sum(cCount)
id 自增id
cCount 计数
cPage 页面
cDate 时间每次update的时候,先判断是否有该记录,
没有:
insert into mCount(cCount,cPage,cDate) values(1,'页面',curDate())
有,得到id:
update mCount set cCount=cCount+1 where id=$idmysql为例,如果要求是某页,则后面加上 and cPage='页面'
当天:where cDate=CURDATE()
当月:where MONTH(cDate)=MONTH(CURDATE())
昨天:where cDate=CURDATE()-1
7天内:where cDate>CURDATE()-7如果要必须是有记录的,则按cDate排序,取前几天记录,sum(cCount)
id 自增id
cCount 计数
cPage 页面
cDate 时间每次update的时候,先判断是否有该记录,
没有:
insert into mCount(cCount,cPage,cDate) values(1,'页面',curDate())
有,得到id:
update mCount set cCount=cCount+1 where id=$idmysql为例,如果要求是某页,则后面加上 and cPage='页面'
当天:where cDate=CURDATE()
当月:where MONTH(cDate)=MONTH(CURDATE())
昨天:where cDate=CURDATE()-1
7天内:where cDate>CURDATE()-7如果要必须是有记录的,则按cDate排序,取前几天记录,sum(cCount)
你的方法不错,我觉得应该想秋水无恨学习。
你的方法不错,谢谢!
我的显示统计页面的时候,假如有以下几个内容:
总访问量:
今日访问量:
当月访问量:
a 页面访问量:
B页面访问量:
C页面访问量:
……
我写QUERY是不是要写很多查询语句然后mysql_query?
如果记录多的话是不是很慢?