Yii find condition >=
34,370
Solution 1
I dont have Yii at hand. Have you tried this:
$criteria = new CDbCriteria;
$criteria->addCondition('summ >= 250');
$winnerBid = Bids::model()->find($criteria);
This should work, if summ
is a column mapped correctly.
Solution 2
It will be usefull, try this -
$winnerBid = Bids::model()->find(array('condition'=>"summ >= 250"));
Solution 3
$winnerBid = Bids::model()->find('summ >= 250');
if ($winnerBid===null) {
throw new CHttpException(400,'There is no record in your database with summ>=250.');
}
Author by
Joeeee
Updated on April 07, 2020Comments
-
Joeeee about 4 years
I need to find row where summ>=250
I am doing following:
$criteria = new CDbCriteria; $criteria->condition ='summ >= 250'; $winnerBid = Bids::model()->find($criteria);
But I am getting no results. How to implement?