• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help please!

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

public function displayClientsFormsPage(){
    $data['title'] = 'Clients Form';
    $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->session->set_flashdata('message','New Client Added');

here's the model

public function insertClient($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

Are you sure that 3 "="'s are correct?


I think it should be the following, I'm also quite new to CodeIgniter:


What does your _submit_validate() method do?

Nonetheless: Your insertClient() method is wrong. It should be

function insertClient($data)
  if ( $this->db->insert('table_name', $data) )
    return TRUE;
  return FALSE;

my _submit_validate is my funtion for setting the rules in my forms.. well thank you I already find the problem Smile tnx for the effort bros.. Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.