Merge pull request #6044 from jsirish/patch-1

Docs - sort by random instructions
This commit is contained in:
Will Rossiter 2016-09-21 07:46:18 +12:00 committed by GitHub
commit 796ca2171d

View File

@ -268,10 +268,11 @@ However you might have several entries with the same `FirstName` and would like
'LastName'=>'ASC'
));
You can also sort randomly.
You can also sort randomly. Using the `DB` class, you can get the random sort method per database type.
:::php
$players = Player::get()->sort('RAND()')
$random = DB::get_conn()->random();
$players = Player::get()->sort($random)
## Filtering Results