In the Codeigniter Framework, I can validate an Unique field in the MYSQL Database using the “Form Validation Class”. Exemple:
$this->form_validation->set_rules('form_field', 'form_label', 'is_unique[table.field]');
Work perfectly, but, I need validate a field from a table with 2 index. Exemple:
UNIQUE INDEX `id_aluno` (`id_aluno`, `ano`),
The Codeigniter Framework can do it natively?
I don’t think that
CIhas built-in case for combinedPKbut I would use callback_ like this: but note that you have to send the secondPKas extra and the rule should be applied on the first $PK see callbacks for more info about that