Привет @ Сарат см. Пример ниже -
protected function YourFormValidation() {
$this->form_validation->set_rules('email', 'Email', 'trim|required|callback_IsEmail_exist');
$this->form_validation->set_message('required', '%s is required');
if ($this->form_validation->run($this) == FALSE) {
return false;
} else {
return true;
}
}
, а функция обратного вызова - -
function IsEmail_exist(){//print_r($_POST);die;
$existing_email = $this->db->where("email", $this->input->post('email'))->get('table')->num_row();
if($existing_email != ""){
$this->form_validation->set_message('email', 'Email ID already Exist.');
return false;
}
}
.и т.д.