我在 Yii 框架上有一个网站,我想在表格中搜索匹配的单词。
我不断得到"out of memory"
(这是一张大桌子)。
我尝试了这段代码,但它一直在加载页面
$dataProvider = new CActiveDataProvider('Data');
$iterator = new CDataProviderIterator($dataProvider);
foreach($iterator as $data) {
echo $data->name."\n";
}
所以我尝试了这段代码,但它一直将结果限制为 10:
$dataProvider = new CActiveDataProvider('Data');
$iterator = new CDataProviderIterator($dataProvider);
foreach($dataProvider as $data) {
echo $data->name."\n";
}
如果我这样做,我会收到“内存不足”消息:
$dataProvider = new CActiveDataProvider('Data' array(
'criteria'=>array(
'order'=>'id DESC',
),
'pagination' => false
));
foreach($dataProvider as $data) {
echo $data->name."\n";
}