If i understand ur problem then you can try this
Model:
function get_subsection($sec_id,$subsec_name){
$this->db->selec("*");
$this->db->where('sec_id',$sec_id);
$this->db->where('subsec_name !=',$subsec_name);
$query=$this->db->get('sub_section');
return $query->result();
Controller:
function edit($id){
$data['rec']=$this->amodel->edit_art($id);//get the record to update
foreach($data['rec'] as $a)
{
$data['items']=$this->amodel->section('$a->sec_id');//select all sections without that which selected by user
$data['sub']=$this->amodel->subsection($a->sec_id,$a->subsec_name);//select all subsections of a section which selected by user
}
$this->load->view('edit_art',$data);
}
View :
<?php echo form_dropdown('items',$items,"",'class=""'); ?>
<?php echo form_dropdown('sub',$sub,"",'class=""'); ?>
Let me know is it ok or not. if not ok then post your view code.