我有两个表:1.以学生领域是 - (studentid,studentname,批次) 2.分批领域是 - (batchid,batchname)如何填充从数据库下拉列表中的笨?
我想填充从外地下拉列表“batchname “(从表中‘批量’),并具有基于现场选择时将batchName”批量”(从表‘学生’)
我的控制器 -
function update($id){
$this->load->model('mod_studentprofile');
$data['query']= $this->mod_studentprofile->student_get($id); //to retrieve information from the table "STUDENT"
$data['query']= $this->mod_studentprofile->batch_get();
$data['main_content']='update_studentprofile';
$this->load->view('includes/template',$data);
}
我的模型 -
function batch_get()
{
$query = $this->db->get('batch');
return $query->result();
}
现在
,我无法弄清楚如何填充下拉列表中的“查看”。你能否帮我解决这个问题?
在此先感谢。