0
我想显示数组的值,但它只显示数组的一个值而不是数组的所有值。Codeigniter数组显示
型号:
function get_subject_position($exam_id , $class_id , $subject_id) {
$this->db->where('exam_id' , $exam_id);
$this->db->where('class_id' , $class_id);
$this->db->where('subject_id' , $subject_id);
$this->db->select('mark_obtained');
$this->db->order_by('mark_obtained DESC');
$subject_position = $this->db->get('mark')->result_array();
foreach($subject_position as $row) {
return $row;
}
}
查看:
$subject_pos = $this->crud_model->get_subject_position($row2['exam_id'], $class_id, $row3['subject_id']);
<td style="text-align: center;"><?php echo $subject_pos['mark_obtained'];?></td>
你does'n结果发送阵列return语句应该是这样的回报$这个 - > DB->获得( '标记') - > result_array(); –
@RanjeetSingh谢谢,更新了代码 – prasoc
非常感谢 – 4Jean