【问题标题】:select query for date between [closed]选择查询[关闭]之间的日期
【发布时间】:2013-08-11 02:37:59
【问题描述】:

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

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

所以请建议如何做到这一点....任何想法将不胜感激。

【问题讨论】:

  • 我认为您需要将&& 替换为AND

标签: php mysql


【解决方案1】:
&& 

应该替换为

AND

您似乎已经在查询权中使用AND

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

【讨论】:

  • 不工作............
  • 检查控制台是否有任何潜在错误
【解决方案2】:

使用如下查询

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

【讨论】:

  • 不工作............
  • 请您描述一下cnor='$nme'这部分吗?在这种情况下你想拿什么?
猜你喜欢
  • 2020-06-06
  • 2023-03-02
  • 2011-07-04
  • 2015-04-01
  • 2012-03-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多