|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2012-3-13 10:27:14
|
显示全部楼层
模型中:
function m_search()
{
$port= $this->db->query("select id,name from port");
return $port;
}
控制器中:
function c_search()
{
$this->load->model('m_port');
$data=$this->m_port->m_search();
foreach($data->result() as $row)
{
$rate= $this->db->query("select * from rate where pid=$id");
}
$this->smarty->assign('port', $data->result());
$this->smarty->assign('rate', $rate->result());
$this->smarty-display('index.htm');
}
想要的效果是![](http://codeigniter.org.cn/forums/static/image/common/emp.gif) |
|