How To Avoid The Null Values When I Load The Datas Using Dataprovider

I have one doubt in data provider, I have more number of fields in the db.If i retrieve the data in specific field,it fetch null values as well as exist values are shown here.I want only the exist values .Without null values i want to load the vales How to do that…Anyone know please help me.

For example C grid view data provider 5 rows have null values in db and another 5 rows have values i want load without null values…please help me… :(

public function actionDataProvider() {

$uid=Yii::app()->user->id;


 if(isset($_GET['user_id']))


	 $uid=$_GET['user_id'];


	 $criteria = new CDbCriteria();


	 $criteria->condition=("user_id= $uid ");


	 $dataProvider=new CActiveDataProvider('UserGallery',array('criteria'=>$criteria,'pagination'=>array('pageSize'=>20)));


 $this->render('product_pic',array('model' => userGallery::model()->findAll($criteria),'dataProvider'=>$dataProvider,));

}

Try:

$dataProvider->criteria->addCondition(‘user_id is not null’);

or

$criteria->condition = ("user_id is not null");

It is not working Novalogic any other way to achieve this function

Try like this:


$criteria = new CDbCriteria();

$criteria->addCondition('user_id=' . $uid);

$dataProvider=new CActiveDataProvider('UserGallery',array('criteria'=>$criteria,'pagination'=>array('pageSize'=>20)));

Thank u for ur response Navilink

It is also not working.

I have two functionality in gallery.In a single table i have two fields i,e profile picture and another one is product picture

If i selected profile picture the product picture field is null value.If i selected the product picture ,the profile picture column is null.

I loaded the product and profile picture independently using dataprovider.

It displays with null values.that is empty column display in the view.how i avoid this Plz help me.