Posted By

saturnxxi on 10/28/09


Tagged

database propel


Versions (?)

Get random Objects with Propel


 / Published in: PHP
 

URL: http://snipplr.com/developer/

  1. public static function getRandomUsers($num=1){
  2. $c = new Criteria();
  3. $c->addAscendingOrderByColumn('rand()');
  4. $c->setLimit($num);
  5. $users = UserPeer::doSelect($c);
  6. return $users;
  7. }

Report this snippet  

You need to login to post a comment.