我有这个错误在我看来并不能找出问题出在哪里:未定义的变量(笨)
我的控制器名“问题”:
public function show_all_question_set() {
$data = array();
$data['question_set'] = $this->Question_Model->select_all_question_set();
$this->load->view('question/make_set', $data);
}
我的型号名称“Question_Model “:
public function select_all_question_set() {
$this->db->select('*');
$this->db->from('tbl_question_set');
$query_result = $this->db->get();
$result = $query_result->result();
return $result;
}
我的观点名 'MAKE_SET':
<?php
foreach ($question_set as $all_set) {
?>
<tr>
<td align="center">
<a href="#" class="btn btn-default"><em class="fa fa-pencil"></em></a>
<a href="#" class="btn btn-danger"><em class="fa fa-trash"></em></a>
</td>
<td> <?php echo $all_set->exam_name; ?> </td>
<td> <?php echo $all_set->subject_name; ?> </td>
<td> <?php echo $all_set->set_name; ?> </td>
<td align="center">
<a href="#"class="btn btn-default"><em class="fa fa-book"> দেখুন </em></a>
</td>
</tr>
<?php } ?>
表:tbl_question_set(SET_ID,EXAM_NAME,SUBJECT_NAME,set_name)
甲PHP错误遇到 严重性:注意 消息:未定义变量:question_set 文件名:质询/ make_set.php 行号:90 – Rashed
因此,这是线路90 ?? – Sparky
第90行是:foreach($ question_set as $ all_set){ – Rashed