开发者

Shuffled result in ORM query

Let say开发者_开发百科 that I have a table of some data. I want am running a query using ORM in Kohana 2.3.

ORM::factory('somemodel')->find_all(); // ordered by $sort

I want to modify that query to return shuffled results.


Use rand.

Here is the example for it

http://docs.kohanaphp.com/libraries/database/builder#orderby

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜