php - CDbCriteria condition from another CDbCriteria -
i don't if want possible or not, have 2 models want info 1 model using status another.
$criteria1=new cdbcriteria; $paramids = $s['param_id']; $stress = model1::model()->find($criteria1); $mycondition= ($stress->stress_value); echo $mycondition ; // value , want utilize // status next cdbcreteria $criteria2=new cdbcriteria; // status $criteria2->addcondition(array('pressure_value' > $mycondition)); // can't perform status $criteria2->order = "pressure_value desc"; $pressure = model2::model()->find($criteria2);
any thought ? code wrong or want not possible in way ?
many thanks
thanks @Örs
your solution work me making compare statement in cdbcreteria after condition
$criteria2->params = array(':value' => $mycondition)
php yii
No comments:
Post a Comment