Copy the Code code as follows:
$now =time (); Current time
$StrUpdate = "Update $tbl _article set hits=hits+1";
if (Date ("D", $lasthittime) ==date ("D", $now)) {//the 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);
Do not know how to use Ah, first analysis and then again
But the feeling seems to have some problems, if it is the day should first judge the year is the same, and then judge the day.
The above describes the Photoshop CS5 official Chinese official original download PHP day, week, month click Ranking statistics, including the official Chinese version of Photoshop cs5 the original download content, I hope that the PHP tutorial interested friends helpful.