|
楼主 |
发表于 2008-11-6 00:28:43
|
显示全部楼层
我在Controllers這樣寫
PHP复制代码 $this->load->model('modelacm');
$query['data'] = $this->modelacm->select_acm($data);
$this->load->view('view_acmdata',$query);
$this->login_acm(); 复制代码
在Model
PHP复制代码 function select_acm ($data)
{
$PersonID = $data->;PersonID ;
$Status = $data->Status;
$AssocChairType = $data->AssocChairType;
$AssocChairManID = $data->AssocChairManID ;
$this->load->database();
$this->db->select('*');
$this->db->where('"AssocChairMan"."ersonID" = ',$PersonID);
$this->db->or_where('"AssocChairMan"."Status" = ',$Status);
$this->db->or_where('"AssocChairMan"."AssocChairType" = ',$AssocChairType);
$this->db->or_where('"AssocChairMan"."AssocChairManID" = ',$AssocChairManID);
$this->db->from('AssocChairMan');
$this->db->join("AssocChairMan", "AssocChairMan.PersonID = PersonMaster.PersonID");
$query = $this->db->get();
return $query;
} 复制代码
在view
PHP复制代码 foreach($data->result() as $row){
echo '<TD align=left>';
echo $row->;PersonID;
echo '</TD>';
echo '<TD align=left>';
echo $row->ChineseName;
echo '</TD>';
echo '<TD align=left>';
echo $row->Sex;
echo '</TD>';
echo '<TD align=left>';
echo $row->Status;
echo '</TD>';
} 复制代码
不過還是出現錯誤!
是在view的foreach($data->result() as $row)這一段
是那裡出了錯!!
我不太懂妳說的意思
[ 本帖最后由 kfrico 于 2008-11-6 00:30 编辑 ] |
|