Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yii find condition >=

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?

like image 671
Joeeee Avatar asked Mar 17 '11 05:03

Joeeee


1 Answers

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.

like image 193
Winfred Avatar answered Oct 05 '22 13:10

Winfred