Welcome Guest, Not a member yet? Register   Sign In
Database INSERT changes default 'no' to NULL
#9

You could also modify your insert array like this:


Code:
$client_data = array(
    'account_num' => $client_acct_num,
    'title' => $this->input->post('title'),
    'first_name' => $this->input->post('first_name'),
    'middle_name' => $this->input->post('middle_name'),
    'last_name' => $this->input->post('last_name'),
    'age' => $this->input->post('age'),
    'sex' => $this->input->post('sex'),
    'guidelines' => $this->input->post('guidelines'),
    'guidelines_signed' => ( $this->input->post('guidelines_signed') == 'yes' ? 'yes' : 'no' ),
    'signed_date' => $this->input->post('signed_date'),
    'home_address1' => $this->input->post('home_address1'),
    'home_address2' => $this->input->post('home_address2'),
    'home_city' => $this->input->post('home_city'),
    'home_prov'  => $this->input->post('home_prov'),
    'home_postal'  => $this->input->post('home_postal'),
    'home_phone' => $this->input->post('home_phone'),
    'phone_msg' => $this->input->post('phone_msg'),
    'cell_phone' => $this->input->post('cell_phone'),
    'work_phone' => $this->input->post('work_phone'),
    'work_ext' => $this->input->post('work_ext'),
    'email' => $this->input->post('email'),
    'home_mail' => $this->input->post('home_mail'),
    'mail_address1' => $this->input->post('mail_address1'),
    'mail_address2' => $this->input->post('mail_address2'),
    'mail_city' => $this->input->post('mail_city'),
    'mail_prov' => $this->input->post('mail_prov'),
    'mail_postal' => $this->input->post('mail_postal'),
    'contact_notes' => $this->input->post('contact_notes'),
    'inquiry_type' => $this->input->post('inquiry_type'),
    'other_inquiry_type' => $this->input->post('other_inquiry_type'),
    'ask_notes' => $this->input->post('ask_notes'),
    'visit_date' => $this->input->post('visit_date'),
    'time_spent' => $this->input->post('time_spent'),
    'assignment_date' => $this->input->post('assignment_date'),
    'coordinator_id' => $user_id,
    'referred_by' => $this->input->post('referred_by'),
    'repeat_client' => $this->input->post('repeat_client'),
    'repeat_notes' => $this->input->post('repeat_notes'),
    'careplanner_id' => $this->input->post('careplanner_id'),
    'case_status' => $this->input->post('case_status'),
    'status_change_date' => $this->input->post('status_change_date'),
    'church_id' => $this->user_model->get_user_church($user_id)->church_id
);
Reply


Messages In This Thread
RE: Database INSERT changes default 'no' to NULL - by skunkbad - 03-08-2016, 03:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB