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
精彩评论