Select Date Greater Than

Can someone tell me how I can select date for example >2000-08-30 ??

I’m trying to export my data to excel (Condition -> value from _form). Now I can get DATE != NULL and !=0000-00-00




public function actionCreateExcel(){

			

		  Yii::import('ext.phpexcel.XPHPExcel'); 

                            

                          $criteria=new CDbCriteria;

                          

                          $mydate = $_GET['excelDate'];

                          $criteria->condition="membersince>$mydate";


                          (...)


                           $model = new Member;

                           $labels = $model->attributeLabels();

                           

                           $data = Member::model()->findAll($criteria);


                          etc.



And Excel:

Try:


$criteria->condition="membersince>'$mydate'";

it’s working. Thx ;)

It’s not safe.

So how would you do it ??

And when I want to pick data in range of dates f.e.

between 2005-08-30 and 2007-08-30 how should I do it ??

http://www.yiiframework.com/doc/api/1.1/CDbCriteria#addBetweenCondition-detail

Yea… with ‘AND’ it works perfectly. Can you tell me 1 thing. When I use


$criteria->condition="something=0"

I can add 5 condition like that and it will select as "OR" statement.

But what if I want to make only ‘AND’ statement ?

Read the docs, srsly.


public CDbCriteria addCondition(mixed $condition, string $operator='AND')