title: how to solve A PHP Error was encountered codeigniter3
body: <p>why i can't access it?</p>
  
  <pre><code>my model
  News_model.php :
  
          &lt;?php 
          class News_model extends CI_Model
          {
  
            public function __construct()
            {
              $this-&gt;load-&gt;database();
            }
  
            public function get_news(){
              $query = $this-&gt;db-&gt;get['news'];
              return $query-&gt;result_array();
            }
  
          }
  
          ?&gt;  
  
      my Controller
      news.php :
  
          &lt;?php
      defined('BASEPATH') OR exit('No direct script access allowed');
  
      class News extends CI_Controller {
  
        public function __construct (){
          parent::__construct();
          $this-&gt;load-&gt;model('news_model');
          $this-&gt;load-&gt;helper('url_helper');
        }
  
        public function index()
        {
          $data['news'] = $this-&gt;news_model-&gt;get_news();  
          $data['title'] = 'arsip';
          $this-&gt;load-&gt;view('news/index', $data);
        }
      }
      ?&gt;
  my view
  news/index.php
  
  &lt;?php
  foreach ($news as $news_item) { ?&gt;
    &lt;h1&gt;&lt;?php echo $news_item['title']; ?&gt; &lt;/h1&gt;
    //  &lt;p&gt;&lt;?php echo $news_item['text']; ?&gt; &lt;/p&gt;
  &lt;? } ?&gt;
  
  ?&gt;
  
  routes :
  &lt;?php
  defined('BASEPATH') OR exit('No direct script access allowed');
  
  $route['news'] = 'news';
  $route['default_controller'] = 'halaman/view';
  
  $route['(:any)'] = 'halaman/view/$1';
  
  $route['404_override'] = '';
  $route['translate_uri_dashes'] = FALSE;
  </code></pre>
  
  <p>and then acces
  <a href="http://localhost/codeigniter/index.php/news" rel="nofollow noreferrer">http://localhost/codeigniter/index.php/news</a>
  the output is :</p>
  
  <p>A PHP Error was encountered</p>
  
  <blockquote>
    <p>Severity: Notice</p>
    
    <p>Message: Undefined property: CI_DB_mysqli_driver::$get</p>
    
    <p>Filename: models/News_model.php</p>
    
    <p>Line Number: 11</p>
    
    <p>Backtrace:</p>
    
    <p>File: /opt/lampp/htdocs/codeigniter/application/models/News_model.php
    Line: 11 Function: _error_handler</p>
    
    <p>File: /opt/lampp/htdocs/codeigniter/application/controllers/News.php
    Line: 14 Function: get_news</p>
    
    <p>File: /opt/lampp/htdocs/codeigniter/index.php Line: 315 Function:
    require_once</p>
    
    <p>Fatal error: Call to a member function result_array() on null in
    /opt/lampp/htdocs/codeigniter/application/models/News_model.php on
    line 12 A PHP Error was encountered</p>
    
    <p>Severity: Error</p>
    
    <p>Message: Call to a member function result_array() on null</p>
    
    <p>Filename: models/News_model.php</p>
  </blockquote>