POST Codeigniter?

Asked

Viewed 247 times

0

I’m doing a CRM in codeigniter and I’m having doubts in a following situation, I made a Join between my client table and called, every client has called but when it comes to inserting, I’m not getting.

function novoChamado($cliente_id){
  $data = array(
    'chamado_atividade'          => $this->input->post('chamado_atividade'),
    'chamado_duracao_minuto'     => $this->input->post('chamado_duracao_minuto'),
    'chamado_duracao_hora'       => $this->input->post('chamado_duracao_hora'),
    'chamado_assunto'            => $this->input->post('chamado_assunto'),
    'chamado_data'               => $this->input->post('chamado_data'),
    'chamado_hora'               => $this->input->post('chamado_hora'),
    'chamado_atendente_rf'       => $this->input->post('chamado_atendente_rf'),
    'chamado_atendente_cliente'  => $this->input->post('chamado_atendente_cliente'),
    'chamado_obs'                => $this->input->post('chamado_obs'),
    'chamado_telefone'           => $this->input->post('chamado_telefone'),
    'chamado_email'              => $this->input->post('chamado_email'),
    'chamado_id_cliente'         => $this->input->post($cliente_id),

  );
  $this->db->insert('chamado', $data);
}

in that part chamado_id_cliente => $this->input->post($cliente_id) I’m passing the variable of id of the customer to complete the Join, but still it goes null to the bank.

  • only use $cliente_id

  • See that your input->post() will take what comes from your view, through an ajax or form... and you are setting in it a variable.

  • 1

    It complicates a lot when the author of the question does not interact with those who want to help, that code does not need to be done already seen that $this->input->post() already returns the array associative that needs if you need to create any more items in the array add a line only with the chamado_id_cliente... So far your question has not been answered for lack of information.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.