Jquery中文网 www.jquerycn.cn
Jquery中文网 >  脚本编程  >  php  >  正文 php mysql查询指定范围内日期

php mysql查询指定范围内日期

发布时间:2018-01-09   编辑:www.jquerycn.cn
本文介绍了php mysql中查询指定范围日期的一个例子,介绍了between语句的用法,有需要的朋友做个参考。

php时间戳查询。
如果数据库时间显示的是 2011-04-05,则不需要用 strtotime 时间戳转换函数。

例子,php时间段查询。
 

复制代码 代码示例:
<?php
$timea = strtotime($_POST['timea']);
$timeb = strtotime($_POST['timeb']);
$sq2="select * from `ecs_order_info` where add_time between '$timea' and '$timeb' and `quanxian`='$dangqian' order by `order_id` DESC limit 50";
$sql = mysql_query($sq2);

您可能感兴趣的文章:
php mysql查询指定范围内日期
php查询指定日期范围内数据
mysql时间查询常用语句大全
Mysql查询一段时间记录方法详解
mysql 随机生成某个范围内的整数
mysql 时间段查询语句大全
mysql日期详解
PHP日期查询函数实用代码
php与Mysql日期时间(UNIX时间戳、格式化日期)转换的方法
如何开启mysql和php慢日志

关键词: mysql日期查询  日期查询   
[关闭]