Yii::app()->db->createCommand($sql1)->queryAll() is not returning whole table [closed]

匿名 (未验证) 提交于 2019-12-03 10:09:14

问题:

$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.

回答1:

queryAll() returns an array and u need to iterate in order to get all the records

foreach($rows as $row){   //do something } 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!