Welcome Guest, Not a member yet? Register   Sign In
validation problem
#2

[eluser]mdowns[/eluser]
Try checking the row only if num_rows > 0:

Code:
$query = $this->user_model->getUser($str);
if($query->num_rows()>0){
  $row = $query->row();

  if(strtolower($str) == strtolower($row->username)){
    $this->validation->set_message('checkUsername', 'The %s "'. $str . '" is already taken.');
    return FALSE;
  }
}

return TRUE;


Messages In This Thread
validation problem - by El Forum - 08-26-2008, 06:52 PM
validation problem - by El Forum - 08-26-2008, 09:00 PM
validation problem - by El Forum - 08-26-2008, 09:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB