Welcome Guest, Not a member yet? Register   Sign In
catch db errors before returning back to controller
#4

[eluser]sanir[/eluser]
create model with the name of duplicate_mod and create a function in that file
Code:
function check_unique($str)
    {
        $query = $this->db->where("fieldname",$str);
        $query = $this->db->get('table_name');
  
        if ($query->num_rows() > 0) {
           return FALSE;
        }else{
           return TRUE;
        }
    }


Messages In This Thread
catch db errors before returning back to controller - by El Forum - 05-29-2012, 11:32 AM
catch db errors before returning back to controller - by El Forum - 05-29-2012, 11:42 AM
catch db errors before returning back to controller - by El Forum - 05-29-2012, 11:56 AM
catch db errors before returning back to controller - by El Forum - 05-29-2012, 11:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB