$rows = Yii::app()->db->createCommand()->select('*')->from('states')->queryAll();
above code returns only single first row, while according to documentation it should return all rows.
$rows = Yii::app()->db->createCommand()->select('*')->from('states')->queryAll();
above code returns only single first row, while according to documentation it should return all rows.
queryAll() returns an array and u need to iterate in order to get all the records
foreach($rows as $row){ //do something }