I have a view with a dropdown field that gets filled
via the listData method.
That is :
$list=CHtml::listData(Customers::model()->findAll($criteria), 'CustomerID', 'CustomerID'); echo $form->dropDownList($model,'CustomerID',$list);
As long as the Customer Table is relatively small, everything works fine.
After a data migration we did , the Customers Table increased ,so now we have 65.000 records.
The above mentioned code doesn’t work anymore.
Insted I get the message :
[i]Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 81 bytes) in /MyApp/framework/db/CDbCommand.php on line 516
After searching the yii forum and the internet ,
-increasing the memory_limit in php.ini to unlimited (-1) -setting memory_limit from index.php like ini_set("memory_limit","512M"); -disabling the yii DEBUG mode
nothing changed.The problem persists.
Somebody , suggested not to use ActiveRecord for big amounts of Data,
but our whole application is built using ActiveRecords.
Although , IMHO , I don’t think it is a server problem.(Apache)
Because when I request the same Data (and more complex) with plain php
the server responds immediately.
So ,is there an alternative way in yii to fill such dropdowns with huge amount of data ?
What else would you suggest ?
Many thanks in advance.