Welcome Guest, Not a member yet? Register   Sign In
Returning Boolean Values from model not working
#1

[eluser]timboland[/eluser]
I seem to be getting some odd results returning a boolean value from a model. Appears the type is lost when the result gets back to the controller, the controller keeps showing the value as FALSE, when I can see the logic should be returning true. Anyone seen this. Using 1.6.3

MODEL
Code:
function UpdateClientEmail($data)
    {
        $mybool = true;
        //FIRST MAKE SURE A USER DOESN'T EXIST
        $this->db->where('clientemail', $data['clientemail']);
        $user_exist = $this->db->get('clientemail');
        if ($user_exist->num_rows() > 0 )
        {
            $mybool = false;
        }
        else
        {
            $this->db->where('id', $data['id']);
            $this->db->update('clientemail', $data);
            $mybool = true;
        }
        
        return $mybool;
    }

CONTROLLER
Code:
function edituserfast($type)
    {
        //UPDATE
        $this->load->model('client/Client_model');
        if ($this->Client_model->UpdateClientEmail($_POST))
        {
            echo $_POST[$type];
        }
        else
        {
            echo "User name already exists";
        }
        
    }


Messages In This Thread
Returning Boolean Values from model not working - by El Forum - 10-30-2008, 02:01 PM
Returning Boolean Values from model not working - by El Forum - 10-30-2008, 08:58 PM
Returning Boolean Values from model not working - by El Forum - 10-31-2008, 08:18 AM
Returning Boolean Values from model not working - by El Forum - 10-31-2008, 08:33 AM
Returning Boolean Values from model not working - by El Forum - 10-31-2008, 08:44 AM
Returning Boolean Values from model not working - by El Forum - 10-31-2008, 08:46 AM
Returning Boolean Values from model not working - by El Forum - 10-31-2008, 08:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB