This is a situation I have found myself in a few times and I just want clear it up once and for all.
Best just to show you what I need to do in some example code.
You should do a join in your model for both tables, and create one result which you will move later to your view trough the controller.
Remember not to put queries in your controller.
maybe somthing like this:
function get_data($cue_sheets){
$this->db->select(clips.*);
$this->db->from('clips');
$this->db->join('cue_sheets', 'clips.idcuesheet = cue_sheets.idcuesheet' );
$this->db->where('cue_sheets.idcuesheet', $cue_sheets);
$query = $this->db->get();
}
Or something similar.
Then you bring it to the controller
$data['clips'] = $this->clips->get_data($cue_sheets);
and finally to your view
foreach($clips as $clip){
echo $clip->clip_name;
}
Hope it helps