Can I run the query in the Clistview view file.

Can I run the query in the Clistview view file.

In the list when one row has a certain value I want it to run a query in the database to return a column value as per it.

ie. if 1 is returned in row 1 of list view I want to run a query in abc table with value one and return a value as per it

Look at this: Active Record

In particular:


// get the number of rows satisfying the specified condition

$n=Post::model()->count($condition,$params);

So in your controller, count the number of rows returned by your initial query, if this equals 1 then just do a new query to get the related data and send this to your view.

I am using dataprovider can I send other data alongwith dataprovider

Also the above option does help but there is certain data which will have to run a query once it is brought in a view file

Any Help?