bleu
(Zend W)
October 8, 2011, 8:17am
1
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
outrage
(Site Sense Web)
October 10, 2011, 12:37am
2
bleu:
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.
bleu
(Zend W)
October 10, 2011, 6:29am
3
outrage:
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
bleu
(Zend W)
November 5, 2011, 12:18pm
4
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