// myController
public function insertNewRole($select_access){
if(!empty($this->input->post($select_access)))
{
foreach ( $this->input->post($select_access) as $obj)
{
$select_access[]= $obj;
}
}
$this->RoleModel->saveRole($select_access);
}
// myModel
public function saveRole()
{
$checkboxes = $this->input->post($select_access);
foreach($checkboxes as $obj)
{
$this->db->insert('roles_global_access',array($select_access=>$obj));
}
}