Home >Backend Development >PHP Tutorial >photoshop cs5 official Chinese official original download PHP daily, weekly, monthly click ranking statistics

photoshop cs5 official Chinese official original download PHP daily, weekly, monthly click ranking statistics

WBOY
WBOYOriginal
2016-07-29 08:47:41967browse

Copy the code The code is as follows:


$now=time(); //Current time
$StrUpdate = "Update $tbl_article set hits=hits+1";
if(date("d",$ lasthittime)==date("d",$now)){//Same day
$StrUpdate = $StrUpdate.",dayhits = dayhits+1";
}else{
$StrUpdate = $StrUpdate.",dayhits = 0";
}
if(date("W",$lasthittime)==date("W",$now)){//Same week
$StrUpdate = $StrUpdate.",weekhits = weekhits+1";
}else{
$StrUpdate = $StrUpdate.",weekhits = 0";
}
if(date("m",$lasthittime)==date("m",$now)){//Same month
$StrUpdate = $StrUpdate.",monthhits = monthhits+1";
}else{
$StrUpdate = $StrUpdate.",monthhits = 0";
}
$StrUpdate = $StrUpdate.",lasthittime='$now' where"; //Update click time
$fsql->query($StrUpdate);


I don’t know if it’s easy to use, I’ll analyze it first. But it feels like there are some problems. If it’s the day, you should first judge the year. The months are all the same, and then we judge the day.
The above introduces the photoshop cs5 official Chinese official original download PHP daily, weekly, and monthly click ranking statistics, including the content of photoshop cs5 official Chinese official original download. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn