PHP:日期之间的日期

时间:2010-11-17 09:49:41

标签: php sql date between

我有两个日期:

10-11-2010 and 17-11-2010

现在我想选择所有具有这两者之间日期的行。

我该怎么做?

3 个答案:

答案 0 :(得分:8)

在where子句中使用between非常简单  ,read more

select * from mytable where date between '10-11-2010' and '17-11-2010'

答案 1 :(得分:2)

听起来像是一个SQL问题。 Try the between condition.

答案 2 :(得分:1)

$ datefrom =日期(' Y-M-d&#39); $ dateto =日期(' Y-M-d&#39);

$ sql ='从mytable中选择*,其中$ datefrom和$ dateto之间的存款日期为&#39 ;;