Welcome Guest, Not a member yet? Register   Sign In
controller function form validation
#5

[eluser]ppwalks[/eluser]
Code:
function something_exists($something)
{
  $query = $this->db->get_where('something', array('something' => $something));
  
  if($query->num_rows() > 0)
  {
   $this->form_validation->set_message('something_exists', 'The %s already exists in our database, please use a different one.');
   return FALSE;
  }
  
  $query->free_result();
  
  return TRUE;
}

Something like this should do it I think, modify for your own purposes...


Messages In This Thread
controller function form validation - by El Forum - 02-13-2012, 08:56 PM
controller function form validation - by El Forum - 02-14-2012, 10:36 AM
controller function form validation - by El Forum - 02-14-2012, 11:51 AM
controller function form validation - by El Forum - 02-14-2012, 12:16 PM
controller function form validation - by El Forum - 02-16-2012, 10:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB