title: Codeigniter method not found in class
body: <p>I just started to learn CodeIgniter. I have some background in PHP but not in OOP. So I've downloaded the CI from their website and started to follow the user guide but I faced some problems like this</p>
  <blockquote>
  <p>Message: Undefined property: News_model::$load</p>
  <p>Filename: models/news_model.php</p>
  <p>Line Number: 7</p>
  </blockquote>
  <p>On that line is the <code>__construct()</code> function</p>
  <pre><code>public function __construct()
  {
      $this-&gt;load-&gt;database();
  }
  </code></pre>
  <p>Also in the next function <code>db field not found in class 'News model'</code> and <code>method 'result_array' not found in class...</code></p>
  <pre><code>public function get_news($slug = FALSE)
  {
      if ($slug === FALSE)
      {
          $query = $this-&gt;db-&gt;get('news');
          return $query-&gt;result_array();
      }
  
      $query = $this-&gt;db-&gt;get_where('news', array('slug' =&gt; $slug));
      return $query-&gt;row_array();
  }
  </code></pre>
  <p><strong>I know that this is very basic but I'm a bit lost right now</strong>. I'll be glad if someone can explain or at least point me to another good tutorial/s that I can learn. Here is the full <code>class News_model</code></p>
  <pre><code>class News_model extends CI_Controller {
  
  public function __construct()
  {
      $this-&gt;load-&gt;database();
  }
  
  public function get_news($slug = FALSE)
  {
      if ($slug === FALSE)
      {
          $query = $this-&gt;db-&gt;get('news');
          return $query-&gt;result_array();
      }
  
      $query = $this-&gt;db-&gt;get_where('news', array('slug' =&gt; $slug));
      return $query-&gt;row_array();
  }
  }
  </code></pre>