Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$rows = Yii::app()->db->createCommand()->select('*')->from('states')->queryAll();
上面的代码只返回一个第一行,而根据文档它应该返回所有行。
queryAll() 返回一个数组,您需要迭代才能获取所有记录
foreach($rows as $row){ //do something }