$allvaliddates=$blog->getarraybyquery("SELECT `pubtime` FROM `{$db_prefix}blogs` ORDER BY `pubtime` DESC");
$allvaliddates=$allvaliddates['pubtime'];
$resultdates=array();
$result="";
if (is_array($allvaliddates)) {
foreach ($allvaliddates as $time) {
$y=gmdate('Y', $time+3600*$config['timezone']);
$m=gmdate('n', $time+3600*$config['timezone']);
$resultdates[$y][$m]+=1;
}
第二種
$archives = $DMC->query("SELECT postTime FROM ".$DBPrefix."logs where $saveType ORDER BY postTime DESC");
$articledb = array();
while ($article = $DMC->fetchArray($archives)) {
$article['dateline'] = format_time("Y,m",$article['postTime']);
$articledb[]=$article['dateline'];
}
unset($article);
$archivedb = array_count_values($articledb);
unset($articledb);
沒有留言:
張貼留言