diff --git a/www/application/controllers/All_Tweets.php b/www/application/controllers/All_Tweets.php new file mode 100644 index 0000000..d5bcca1 --- /dev/null +++ b/www/application/controllers/All_Tweets.php @@ -0,0 +1,18 @@ +load->database(); // load database + $this->load->model('All_Tweets_Model'); // load model + $this->output->enable_profiler(TRUE); + } + + public function index() { + $this->data['posts'] = $this->All_Tweets_Model->getPosts(); // calling Post model method getPosts() + $this->load->view('home', $this->data); // load the view file , we are passing $data array to view file + } + +} diff --git a/www/application/models/All_Tweets_Model.php b/www/application/models/All_Tweets_Model.php new file mode 100644 index 0000000..739b05e --- /dev/null +++ b/www/application/models/All_Tweets_Model.php @@ -0,0 +1,13 @@ +db->select("first_name,last_name,username"); + $this->db->from('Users'); + $query = $this->db->get(); + var_dump($query->result_array()); + // return $query->result(); + } + +} +?> diff --git a/www/application/views/home.php b/www/application/views/home.php index acd30ae..42f548f 100644 --- a/www/application/views/home.php +++ b/www/application/views/home.php @@ -1 +1,31 @@ - + + + + + All Tweets + + + + +

Output Data

+ + + + + + + + + + + +
Post IdPost Title
first_name;?>last_name;?>
+ + + + +