In the Codeigniter Framework, I can validate an Unique field in the MYSQL Database using the \"Form Validation Class\". Exemple:
$this->form_validation-&
$this->form_validation->set_rules( 'form_field', 'form_label', 'trima|is_unique[table1.field1],trim|required|is_unique[table.field2]');
use
'trima|is_unique[table1.field1],trim|required|is_unique[table.field2]'
in single code