$batch= $query ['batch']; // I pull this data from a separate model echo form_dropdown('shirts', $options, $batch); function update($id){ $this->load->model('mod_studentprofile'); $data['query']= $this->mod_studentprofile->student_get($id); $data['options']= $this->mod_studentprofile->batchget(); $data['tab'] = "Update Student Information"; $data['main_content']='update_studentprofile'; $this->load->view('includes/template',$data); } function batchget() { $this->db->select('batchname'); $records=$this->db->get('batch'); $data=array(); foreach ($records->result() as $row) { $data[$row->batchname] = $row->batchname; } return ($data); } function student_get($id) { $query=$this->db->get_where('student',array('studentid'=>$id)); return $query->row_array(); } // this wouldn't select 'foo' as you may be thinking $options => array('0' => 'foo', '1' => 'bar'); $batch = 'foo'; echo form_dropdown('shirts', $options, $batch); // this would select foo $options => array('foo' => 'foo', 'bar' => 'bar'); $batch = 'foo'; echo form_dropdown('shirts', $options, $batch);