Well, without any actual code examples, this is going to de pretty tough... Presumably the edit view is a form, and you are using the form helper to generate a dropdown field.
The first thing you need are the categories in the right format to be displayed in the dropdown.
From the CodeIgniter docs :
$options = array(
'small' => 'Small Shirt',
'med' => 'Medium Shirt',
'large' => 'Large Shirt',
'xlarge' => 'Extra Large Shirt',
);
where the array keys are your options values and the array values are the text displayed.
You need to get your categories in this format with your model. I tend to use the id as the option value, so you could have a function like this in your model:
function get_cat(){
$q=$this->db->get('cat');
if ($q->num_rows()>=1){
foreach($q->result() as $row){
$data[$row->id]=$row->name;
}
return $data
}else{
return false;
}
}
and assuming your controller passes the result of that function to the view, you can just do this in your view :
echo form_dropdown('categories', $data);
As a closing note, you might want to start on PHP by developping some things from scratch, not using a framework, you should learn a lot more that way. Just my opinion.