Help With Cdbcriteria And Cactivedataprovider

Hi all

when i used CDbCriteria and CActiveDataProvider to select 2 table and used CGridView to load data, my question is why there are no data in column of Total and Quantity , someone help me please.



$criteria=new CDbCriteria;

$criteria->select = 't.Pro_ID,sum(p.Sales_Price) AS Total,sum(p.Sales_Quan) AS Quantity';

$criteria->join = 'LEFT JOIN Sales_Detail p ON t.Ph_ID = p.Ph_ID';

$criteria->group= 't.Pro_ID';

$data2table=new CActiveDataProvider('Phones',array(











$this->widget('zii.widgets.grid.CGridView', array(









Have you added Total and Quantity as a property of your activerecord class?

ok. it worked, much appreciate :lol: