find方法中where如何找指定Date的数据?

浏览:1944 发布日期:2013/11/02 分类:求助交流 关键字: find date
数据表中有个OnDate的字段(Date类型),现在要找出指定日期的那条记录,用了find()方法。现在要指定where条件,可是怎么写都找不出记录,数据库中是有记录的,字符串的where条件会写,这个Date类型的不会写了,求助。

$map['OnDate'] = array('eq',$ondate->format("%Y-%m-%d"));
$cQuestion = M(map)->where($condition)->find();

$condition['OnDate'] = date("Y-m-d");
$cQuestion = M('Question')->where($condition)->find();

以上两种方法都没返回数据,数据表中是有的
最佳答案
评论() 相关
后面还有条评论,点击查看>>