title: Fatal error: Call to undefined method CI_Model::User_model()
body: <p>Does anyone know how i can get rid of this error: " Fatal error: Call to undefined method CI_Model::User_model()"</p>
  
  <p>This is my user.php</p>
  
  <pre><code>&lt;?php
  defined('BASEPATH') OR exit('No direct script access allowed');
      class User extends CI_Controller{    
          function user_model(){
              parent::User_model();
              $this-&gt;load-&gt;model('user_model','',TRUE);
          }
      public function index(){
          $this-&gt;login();
      }   
      function login(){
      //xss_clean doesn't work...
          $this-&gt;form_validation-&gt;set_rules('username', 'Username',                                  
          'required|trim|max_length[50]');
          $this-&gt;form_validation-&gt;set_rules('password', 'Password',     
          'required|trim|max_length[150]');       
          if ($this-&gt;form_validation-&gt;run() == FALSE){
              $this-&gt;load-&gt;view('view_login');
          }
          else{   
          }
      }
  }
  ?&gt;
  </code></pre>
  
  <p>This is the user_model.php</p>
  
  <pre><code>&lt;?php
  class User_model extends CI_Model {
      function user_model(){
          parent::User_model();
      }
      function check_login($username, $password){
          $sha1_password = sha1($password);
          $query_str = "SELECT user_id FROM users WHERE username = ? and          
          password = ?";
          $result = $this-&gt;db-&gt;query($query_str, array($username,         
          $sha1_password));
          if ($result-&gt;num_rows() == 1){
              return $result-&gt;row(0)-&gt;user_id;
          }
          else{
              return false;
          }
      }
  }
  ?&gt;
  </code></pre>
  
  <p>This is my autoload:<code>$autoload['model'] = array('User_model');</code></p>
  
  <p>I am new to codeigniter and I was following a tutorial, in the video everything went fine, but I get errors ofcrs. 
  Maybe it's an easy answer, but I couldn't get it.</p>