0
如果在我之前詢問了這個問題,很抱歉。我是CodeIgniter的新手,想知道這裏將使用什麼條件,以便它顯示那個特定的數據emp_id
。在我的代碼顯示它使用user_id
數據我想在URL user_id
顯示,但根據emp_id
形式顯示它顯示的是user_id
所有emp_id
數據需要幫助根據CodeIgniter中的emp_id在顯示數據時遇到問題
控制器代碼:
$q="Select emp_id ,month from employee where user_id= $emp_id and year =".date("Y");
$details = $this->data['details'] = $this->evaluation_model->q($q);
//echo"<pre>";print_r($details);die;
$q ='select distinct section_permissions.assigned_for ,section_id , employee.emp_id ,employee.user_id, employee.month from employee join section_permissions on (section_permissions.assigned_for = employee.user_id) where section_permissions.user_id = '.$user_id;
$assigned_name = $this->data['assigned_name'] = $this->evaluation_model->q($q);
視圖代碼
<?php foreach($assigned_name as $assigned){ ?>
<?php foreach($details as $detail){?>
<?php if($assigned['emp_id'] == $detail['emp_id']){?>
thankew :)它爲我工作 – eliana
的歡迎...... –