i have a table named exam_time_table. i want to get the time table of each class. i tried to get the result.but its not getting.
controller
public function index()
{
$this->load->model('exam_model','exam');
$data['exam_data']=$this->exam->select_data();
$this->load->view('welcome_message',$data);
}
Model
public function select_data() {
$this->db->distinct();
$this->db->select('*');
$this->db->from('exam_time_table');
$this->db->group_by('extt_std');
$query = $this->db->get();
return $query->result();
}
View
<?php
foreach($exam_data as $exam)
{
echo $exam->extt_id;
echo $exam->extt_sub;
echo $exam->extt_date;
}
?>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…