Hi I faced a problem when I insert some value from dynamic adding table then it insert with cycle.
But I want to insert all my arrays at once how it possible.
This is my Model:
$id=$this->input->post('id');
$rank=$this->input->post('rank');
$name=$this->input->post('name');
$mob=$this->input->post('mob');
$count = count($this->input->post('id'));
$data = array();
for($i=0, $i>$count; $i++) {
$data[] = array(
'id'=> null,
'pers_no' => $id[$i],
'rank' => $rank[$i],
'name' => $name[$i],
'mobile' => $mob[$i],
'vendor_id' => $vendor[$i],
);
$result = $this->db->insert_batch('workers_tbl', $data);
}