Note: INSERT IN SELECT
This is how I did this can help:
$query = $this->db->get('Table1')->result();
foreach($query as $result)
{
$post_data = array_from_post('filed1,filed2....');
$data = array_merge($result,$post_data);
$this->db->insert('Table2', $data);
}
Here I defined array_from_post in my base model, you can use it as follows:
public function array_from_post($fields){
$data = array();
foreach ($fields as $field) {
$data[$field] = $this->input->post($field);
}
return $data;
}