查询大于某一时间段的的数据记录,mysql数据库的查询语句该如何写!
如,idate字段,它里面存储的数据是: 2007-03-21 01:55:36 这种类型
我现在需要查大于这一个值的所有记录
$sql="select * from user where idate>'2007-03-21 01:55:36'"
这样写是否有误,请各位高手指教
$indate='2007-03-27 01:55:36';
$sql="select * from user where indate >".date($indate);
这种格式也能正常使用,有没有更好的方法来实再这种查询