手机
当前位置:查字典教程网 >编程开发 >php教程 >PHP文章按日期(月日)SQL归档语句
PHP文章按日期(月日)SQL归档语句
摘要:复制代码代码如下:selectFROM_UNIXTIME(pubtime,'%Y-%m')aspubtime,count(*)ascntfr...

复制代码 代码如下:

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文章按日期(月日)SQL归档语句】相关文章:

一个php作的文本留言本的例子(三)

BBS(php & mysql)完整版(一)

PHP获取当前日期和时间及格式化方法参数

也谈 PHP 和 MYSQL

PHP的基本语法

PHP+MYSQL的文章管理系统(二)

fckeditor上传文件按日期存放及重命名方法

php实现CSV文件导入和导出方法

PHP+MYSQL的文章管理系统(一)

PHP时间和日期函数详解

精品推荐
分类导航