[eluser]Helmi_xisnet[/eluser]
Hi all,
This is the code in my view file:
Code:
<p>
<input type="text" name="fullname[]" id="fullname[]" />
-
<input type="text" name="job_title[]" id="job_title[]" />
</p>
<p>
<input type="text" name="fullname[]" id="fullname[]" />
-
<input type="text" name="job_title[]" id="job_title[]" />
</p>
In the real application, these rows are dynamically added/remove by user.
This is my code in my controller (just the sql part):
Code:
for($i = 0, $t = count($_POST['fullname']); $i < $t; $i++) {
$this->applicant->insert_list($i);
}
and this is the model:
Code:
function insert_list($i) {
$data = array(
//'fullname' => $this->input->post('fullname[]'),
//'job' => $this->input->post('job_title[]')
'fullname' => $_POST['fullname'][$i],
'job' => $_POST['job_title'][$i]
);
$this->db->insert('my_table',$data);
}
Now in the model file; if I use $_post[][$i]; it works as expected. What is the equivalent code for $this->input->post?