我有一張表有student_id(Pk)和兩列class_id和class_id2作爲學生的學生可以在兩個類中註冊 我想使用代碼點火器同時獲得列的值和我嘗試陣列,但它似乎沒有工作,因爲它得到所有學生如何從同一個表中的兩列中獲取值
<?php
$students = $this->db->get_where('student' , array('class_id'=>$class_id))->result_array();
foreach($students as $row):?>
<tr class="gradeA">
<td><?php echo $row['roll'];?></td>
<td><?php echo $row['name'];?></td>
<?php
當我的值更改爲class_id2它從該列中的值,但我不知道如果有一種方法我可以得到兩個?
你想獲得通過,它包含兩個class_1和class_2條件where子句的數據。我對嗎? –