validation double data

can anyone help me,

I have 2 columns . 1. no_handphone , 2.event_id , how to create a validation error if we enter data and event_id same no_handphone already in the previous entry

you can make your own validation, here’s the link on how to make your own validation

http://www.yiiframework.com/wiki/168/create-your-own-validation-rule/

Did you consider using ‘unique’ validator?

http://www.yiiframework.com/doc/guide/1.1/en/form.model#declaring-validation-rules

http://www.yiiframework.com/doc/api/1.1/CUniqueValidator