[eluser]Solarpitch[/eluser]
Hey Guys,
I see in the tutorial video's you can submit a the whole post of a form to the database using this simple line.
Code:
$this->db->insert('comments', $_POST);
This doesnt seem to work for me because it's including the value of the submit button and all... and is trying to put that into the query. INSERT INTO...mysubmit...VALUES..('submit');
I have to use this as a work around which seem a little more than what is needed...
Code:
$data = array(
'account' => $this->input->post('account'),
'customer_name' => $this->input->post('customer_name'),
'address1' => $this->input->post('address1'),
'address2' => $this->input->post('address2'),
'address3' => $this->input->post('address3'),
'provence' => $this->input->post('provence'),
'county' => $this->input->post('county'),
'country' => $this->input->post('country'),
'email' => $this->input->post('email'),
'telephone' => $this->input->post('telephone'),
'mobile' => $this->input->post('mobile'),
'fax' => $this->input->post('fax'),
'website' => $this->input->post('website'),
'description' => $this->input->post('website'),
);
$this->report_model->insert_client($data);
Is there something I'm missing with this? The one line using the $_POST seems alot easier and less code. Why is it including the value of the submit button also?