[eluser]Unknown[/eluser]
I'm new in codeigniter please help me.. I have no error when it comes to running my program but the inputs are not recognize my database basically it turns out the data that I inputted does not go to my database.
here is my controller function
Code:
public function displayClientsFormsPage(){
if($this->_submit_validate()===FALSE){
$data['title'] = 'Clients Form';
$this->load->view('vclientsform',$data);
return;
}
else{
$data['last_name'] = $this->input->post('last_name');
$data['first_name'] = $this->input->post('first_name');
$data['owner_contact'] = $this->input->post('owner_contact');
$data['owner_email'] = $this->input->post('owner_email');
$data['owner_gender'] = $this->input->post('owner_gender');
$data['owner_address'] = $this->input->post('owner_address');
$data['contactperson_lastname'] = $this->input->post('contactperson_lastname');
$data['contactperson_firstname'] = $this->input->post('contactperson_firstname');
$data['pet_name'] = $this->input->post('pet_name');
$data['pet_breed'] = $this->input->post('pet_breed');
$data['pet_markings'] = $this->input->post('pet_markings');
$data['pet_gender'] = $this->input->post('pet_gender');
$data['pet_bdate'] = $this->input->post('pet_bdate');
$this->m_user->insertClient($data);
$this->session->set_flashdata('message','New Client Added');
redirect('cform/displayClientsFormsPage');
}
}
here's the model
Code:
public function insertClient($data)
{
if($this->db->insert('tb_pet','tb_owner',$data)){
return TRUE;
}
return FALSE;
}
I think the problem is in my condition because there is a foreign key in my tb_pet specifically owner_id.. I already load my model..
thanks in advance