PHP文章按日期(月日)SQL归档语句

yipeiwu_com6年前PHP代码库
复制代码 代码如下:

select FROM_UNIXTIME(pubtime, '%Y-%m') as pubtime, count(*) as cnt from articles group by FROM_UNIXTIME(pubtime, '%Y-%m')

PHP文章按日期(日)SQL归档
复制代码 代码如下:

select FROM_UNIXTIME(pubtime, '%Y-%m-%d') as pubtime, count(*) as cnt from articles group by FROM_UNIXTIME(pubtime, '%Y-%m-%d')

非时间戳日期格式归档(date_format格式化日期)
复制代码 代码如下:

select date_format(`post_date`,'%Y%m%d') as pubtime, count(*) as cnt from wp_posts where `post_status`='publish' group by date_format(`post_date`,'%Y%m%d') order by `ID` desc
select date_format(`post_date`,'%Y%m%d') as pubtime,date_format(`post_date`,'%m 月 %d 日') as shijian,count(*) as cnt from wp_posts where `post_status`='publish' group by date_format(`post_date`,'%Y%m%d') order by `ID` desc limit 0,7

相关文章

使用PHP实现密保卡功能实现代码<打包下载直接运行>

使用PHP实现密保卡功能实现代码<打包下载直接运行>

效果图:密保卡入库 复制代码 代码如下: $this->load->model('admin/m_mibao'); $data = array(); //生成随机横坐标 $r...

Paypal实现循环扣款(订阅)功能

起因 业务需求要集成Paypal,实现循环扣款功能,然而百度和GOOGLE了一圈,除官网外,没找到相关开发教程,只好在Paypal上看,花了两天后集成成功,这里对如何使用Paypal的支...

php接口与接口引用的深入解析

1、接口的介绍与创建 关键字 :interface 2、接口的引用与规范 关键字 :implements 接口:一种成员属性全...

php利用反射实现插件机制的方法

本文实例讲述了php利用反射实现插件机制的方法。分享给大家供大家参考。具体实现方法如下: 复制代码 代码如下:<?php /**  * @name &n...

php基于dom实现读取图书xml格式数据的方法

本文实例讲述了php基于dom实现读取图书xml格式数据的方法。分享给大家供大家参考,具体如下: <?php $doc = new DOMDocument(); $...