application/models/NewsModel.php
/**
     * Function to Get News From Database.
     * 
     * @return news
     */
Function to Get News From Database.

@return news
Function to Get News From Database . @return news
public function allNews()
    {
        $this->db->order_by('create_at', 'DESC');
        return $this->db->get('news')->result();  
    }
public function allNews ( ) { $ this -> db -> order_by ( 'create_at' , 'DESC' ) ; return $ this -> db -> get ( 'news' ) -> result ( ) ; }
Function to Get News From Database.
Function to Get News From Database .
// Select Particular fields // $this->db->select('title, description'); // return $this->db1->get('news')->result();    // Development Database // Return by query // return $this->db->query('SELECT * FROM `news`')->result(); // Set WHERE Clause // $this->db->where('active', 1); // Sort Data // Set LIMIT // $this->db->limit(4); // Pass condition in array format : We can pass multiple conditions in array. // $this->db->where(array('active'=>1)); // Return by method // Default Database /* Note:---------------------------------
        result() : returns all data in object form
        result_array() : returns all data in array form
        row() : returns single row in object form
        row_array() : returns single row in array form
        */