大家好,我让我的代码更简单只是为了显示错误消息,但现在仍然显示。
public function check_profile_ifexist($id)
{
if($this->input->post('edit')){
$this->form_validation->set_rules('email','Email','trim|valid_email|is_unique[user_details.email]');
$this->form_validation->set_rules('username','Username','trim|min_length[6]|max_length[20]|is_unique[user_details.username]|xss_clean'); $this->form_validation->set_message('is_unique',"That %s already exists!");
$this->form_validation->set_message('max_length', 'the maximum characters for %s is 20');
$this->form_validation->set_message('min_length', 'the minimum characters for %s is 6');
if ($this->form_validation->run())
{
$this->load->model('model_user_manage');
$em=$this->model_user_manage->update_all($id);
}
else
{
$this->view_profile($id);
}
}
}