grid view using condition

Hello i want a gird view but conditional .

for example i have a studentcourserelation table in which i want data only related to particular id not whole table.

my code is below

	public function actionIndex()



		$dataProvider=new CActiveDataProvider('StudentCourseRelation',array(

                'criteria'=>array('condition'=>  $this->id==$login_id)







<h1>Courses Selected by you</h1>





        'type'=>'striped bordered ',










what should i do.above code display whole data of table but i want only those data whom user_id is 2 .

‘condition’ should be something like:

'condition=>  'id="'.$login_id."''

To avoid sql injection, you should of course also use the parameters feature in Yii.