CodeIgniter Forums

Full Version: Callback
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]ibnclaudius[/eluser]
This callback function is not setting the form error message..

Code:
public function exists_user($email) {
  
  $data = array('email' => $email);
  
  $query = $this->Model->get($this->users_table, $data);
  
  if ($query) {
  
   return TRUE;
  
  } else {
  
   $this->form_validation->set_message('exists_user', 'This %s already exists.');

   return FALSE;
  
  }

}

Code:
public function get($table, $data) {
  
  $query = $this->db->get_where($table, $data);

  if ($query) {

   return $query;
  
  } else {

   return FALSE;
  
  }

}