limit problem

I am having a problem with limit not working

im using it like this

where am i going wrong??




public function withdrawTickets($groups,$number)

{

	$tickets=new CActiveDataProvider('Tickets',array(

					'criteria'=>array(

					'condition'=>'games_id=:games_id and user_id= :user_id and group_id is NULL  ',

					'limit'=>5; << this does not work

					'params'=>array(':games_id'=>$groups->data[$number]->games->id,':user_id'=>Yii::app()->user->id),

					),

					));


					foreach($tickets->data as $value)

					{

					$value->group_id=$_POST['Membership']['group_id'];

					//$value->joined=1;

					$value->save();

					}



Try to set var $limit.

it is very strange but works.





$limit = 3;

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

        							'criteria'=>array(

									   'condition'=>' featured=1 ',

									   'limit'=> $limit,

							           'order'=>'RAND()',

								    ),

								));



@mithereal

In your example you put a semicolon ";" after the number 5… there should be a comma "," instead