CActiveRecord Fatal Error

Hi, when i doing query like this:

$sql  = 'SELECT, u.id_lvl, uo.status, uo.subscribe_lwgn, uo.subscribe_lwgn, u.nama_tayang, u.id_user, sb.id_subscribe, sb.security_code ';

				$sql .= 'FROM user u LEFT JOIN user_option uo ON u.id_user=uo.id_user LEFT JOIN subscribe sb ON uo.id_user=sb.id_user WHERE uo.status = "APPROVED" AND ';

				$sql .= 'uo.blocked = 0 AND u.id_lvl = 1 AND sb.id_subscribe <> "" AND (uo.subscribe_lwgn = 1 OR uo.subscribe_news = 1)';

				$sql .= ' ORDER BY u.id_user DESC';

Yii return this error:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 90 bytes) in /home/ecc2/yii/framework/db/ar/CActiveRecord.php on line 1652

any suggestions?


Raise the memory limit in php.ini? Obviously it’s set to 32mb at this point.

Please post how exactly are you querying it and how many rows are in result set.

Thanks for your quick reply.

I have set the memory_limit using ini_set before query script to 128mb. But i still error message like this:

Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 72551 bytes) in /home/ecc2/yii/framework/YiiBase.php on line 333

In addition, i want set memory limit only when needed. And use default value for others.