title: Fatal error: Call to undefined method codeigniter
body: <p>Please help me. I've tried to solve it, but what is the problem in my code? This is my first time to encounter this error. I really need help, please.</p>
  
  <p>This is the error I'm getting:</p>
  
  <pre><code> Fatal error: Call to undefined method supp_model::getsuppid() in C:\wamp\www\minimart\application\controllers\minimart.php on line 19
  </code></pre>
  
  <p>Here is my library:</p>
  
  <pre><code>class minimart extends CI_controller { //myclass
  
  
  function __construct()
       {
  
      parent::__construct();
      }
  
  
  
      function supplier()
      {
          $this-&gt;load-&gt;model('supp_model');
          $id = $this-&gt;uri-&gt;segment(3);
          $mini['allrecords']= $this-&gt;supp_model-&gt;getsuppid($id); //this line give me an error
          $this-&gt;load-&gt;view('view_supplier.php', $mini); 
      }
  </code></pre>
  
  <p>My Model:</p>
  
  <pre><code>class supp_model extends CI_Model {
  
  
  
      function getsuppid($id) //the function exist
      {
          $this-&gt;db-&gt;select('*'); 
          $this-&gt;db-&gt;from('supplier_table');
          $this-&gt;db-&gt;where('supplier_code ', $id);
          $q = $this-&gt;db-&gt;get();
          $result = $q-&gt;result();
          return $result;
      }
  
  }
  </code></pre>