title: PHP Yii criteria select random records with limit
body: <p>I have 1000 questions in the Question Model.
  How do I select 50 questions out of the 10000 randomly using Yii criteria ??</p>
  
  <p>I am using Mysql as the Db</p>
  
  <p>So far I have tried with the following</p>
  
  <pre><code>$criteria = new CDbCriteria;
  $criteria-&gt;limit = 50;
  $criteria-&gt;select = array('id');
  $criteria-&gt;addCondition('chapter = xyz');
  </code></pre>