Validating Of Ideas


I have a tables named as ideyalar and persons.

In the registration page users can not create their profile if the username taken before.

And every user can create their ideas. But there I to face the problem that; users CAN CREATE the ideas with the same name.

I want to restrict this. But I don’t know how…

If you help me, I’ll be glad.

Thanks. Best regards.

P.S: IdeyalarController code:

public function actionCreate()


	$model = new Ideyalar;

	// Uncomment the following line if AJAX validation is needed

	// $this->performAjaxValidation($model);




		$model->istifade = "1";

		$model->idcontact = Yii::app()->user->getId();


			if($model->validate()) {

				$command = Yii::app()->db->createCommand();

				$command->insert ('mqrup', array(

					'idperson'=> Yii::app()->user->getId(),











Use unique validator in your ideas model: