2022-10-27 409
MySQL查询相信大家都不会陌生,下面将为您介绍如何使用MySQL查询实现查询当天发布的所有文章,希望对您学习MySQL查询方面能有所帮助。
代码:
<?php /* *Author:Fanglor *Email:Fanlor@163.com *Url:www.skyleft.com *Date:2009-9-22 */ include"config.php"; $today_start=mktime(0,0,0,date('m'),date('d'),date('Y')); $today_end=mktime(0,0,0,date('m'),date('d')+1,date('Y')); echo$sql="SELECT*FROM`article`WHERE`article_time`BETWEEN'{$today_start}'AND'{$today_end}'"; $list=getAll($sql); if($list){ echo"<pre>"; var_dump($list); echo"</pre>"; } ?>
打印结果:
SELECT*FROM`article`WHERE`article_time`BETWEEN'1253548800'AND'1253635200' array(2){ [0]=> array(7){ ["article_id"]=> string(2)"30" ["article_title"]=> string(14)"11111111111111" ["article_count"]=> string(1)"0" ["article_type"]=> string(1)"1" ["article_tag"]=> string(14)"22222222222222" ["article_content"]=> string(27)"111111111111111111111111111" ["article_time"]=> string(10)"1253626081" } [1]=> array(7){ ["article_id"]=> string(2)"31" ["article_title"]=> string(5)"22222" ["article_count"]=> string(1)"0" ["article_type"]=> string(1)"8" ["article_tag"]=> string(14)"22222222222222" ["article_content"]=> string(27)"222222222222222222222222222" ["article_time"]=> string(10)"1253626095" } }
原文链接:https://77isp.com/post/4431.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态