|
发表于 2008-11-6 15:15:04
|
显示全部楼层
我是这样用的PHP复制代码 $this->db->select('hr.id, hr.position, hr.date, company.companyname');
$this->db->from('hr');
$this->db->join('company', 'company.id=hr.cid', 'left');
$this->db->limit(20);
$data['position_list'] = $this->db->get();
$this->db->select('resume.id, person.truename, person.sex, resume.xueli, resume.zhuanye, resume.date');
$this->db->from('resume');
$this->db->join('person', 'resume.pid=person.id', 'left');
$this->db->limit(20);
$data['person_list'] =$this->db->get(); 复制代码
view:PHP复制代码 <?php
foreach ($person_list->result() as $row) :
?>
<tr>
<td align="left"> <?php echo $row->truename ?></td>
<td align="left"> <?php echo $row->sex? '男':'女'; ?></td>
<td align="left"> <?php echo $row->xueli ?></td>
<td align="left"> <?php echo $row->zhuanye ?></td>
<td align="left"> <?php echo $row->date ?></td>
</tr>
<?php
endforeach;
?> 复制代码
希望对你有帮助 |
|