|
楼主 |
发表于 2010-10-13 20:00:46
|
显示全部楼层
感谢各位,ci敏捷开发上面写的是没有错误的,是我才疏学浅,没有组合起来.下面这样组合起来就可以编辑关联已有数据了.
echo form_label('部门');
$department = array();
$this->db->select('id, name');
$query = $this->db->get('department');
if ($query->num_rows() > 0)
{
foreach ($query->result() as $rows)
{
$department[$rows->id] = $rows->name;
}
}
$this->db->select('id, departID');
$this->db->where('id',$id);
$departquery = $this->db->get('placcar');
$departrow = $departquery->row();
echo form_dropdown('departID' , $department, $departrow->departID); |
|