选择日期之间的查询

时间:2013-08-09 07:31:34

标签: php mysql

我正在做一个项目,我必须获取日期之间的数据加上用户名。 仅date between的查询工作正常,但and操作符以错误方式执行,因此请建议我如何实现它以实现所需的输出。 这是我的代码:

$qry11=mysqli_query($con,"select * from entry where (create_date between '$first' and '$second') && cnor='$nme'");

所以请建议如何做到这一点....任何想法都会高度感激地欣赏。

2 个答案:

答案 0 :(得分:2)

&& 

应替换为

AND

您似乎已在查询中使用AND

(create_date between '$first' and '$second')

答案 1 :(得分:0)

使用下面的查询

$qry11=mysqli_query($con,"select * from entry where (create_date between '$first' and '$second') and cnor='$nme'");
相关问题