Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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;
}

?>

this is my tablewant output like this

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
212 views
Welcome To Ask or Share your Answers For Others

1 Answer

if you have two model class than load like

   $this->load->model(array('exam_model', 'exam'));

or load separate

  $this->load->model('exam_model');

  $this->load->model('exam');

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...