Contoh penggunaan Query

  • findAll(array(‘order’ => ‘name ASC’)), ‘id’, ‘name’)
  • findAll(‘regional_code=:regional_code’, array(‘:regional_code’=>$_POST[‘regional_code’]));
  • $post=Post::model()->find($condition,$params);
  • $post=Post::model()->findByPk($postID,$condition,$params);
  • $post=Post::model()->findByAttributes($attributes,$condition,$params);
  • $post=Post::model()->findBySql($sql,$params);

Sumber : http://www.yiiframework.com/doc/guide/1.1/id/database.ar