N
N
Natapr02015-03-06 12:41:22
Yii
Natapr0, 2015-03-06 12:41:22

Yii2 How to create a validation rule on two unique attributes?

I do like this...

but the validation skips the entry and I get an Exception

Error Info: Array
(
    [0] => 23000
    [1] => 1062
    [2] => Duplicate entry '1-4' for key 'a1_a2'
)

how to make it check for uniqueness on two fields a1 and a2 at once?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question