[eluser]bcarter[/eluser]
Hi there
Yet another noob question I'm afraid....
Can someone tell me if there is a snippet of code I can use to insert multiple $_POST values into a database instead of declaring each one? I'll try and show you what I mean.
Currently I am using the below code
Code:
$insert = array(
'q1'=>$this->input->post('q1'),
'q2'=>$this->input->post('q2'),
'q3'=>$this->input->post('q3'),
'q4'=>$this->input->post('q4'),
'q5'=>$this->input->post('q5'),
'q6'=>$this->input->post('q6'),
'q7'=>$this->input->post('q7'),
'q8'=>$this->input->post('q8'),
'q9'=>$this->input->post('q9'),
'q10'=>$this->input->post('q10'),
'q11'=>$this->input->post('q11')
);
$this->db->insert('results', $insert);
This works fine however there are actually 56 fields. Is there some code that I can use that would put all the values from the form fields into the $insert array?
Thanks for your help!