logoruby


按照时间从晚到早的顺序排序

Posted in rails by wanguan2000 on the 08月 30th, 2008

在mysql 的表里面建立一个这个列:

create_at

rails 就会自动的为数据建立时间标签.

查询:

@order = User.find (:all,

:conditions => “name = ‘Dave’ ”

:o rder => “create_at DESC”

)

评论关闭

Comments are closed.