title: undefined method in model in codeigniter
body: <p>I have made an admin page and user page, and i want to show the list of users who have registered in database when the admin logs in.
  For that i've created a model as follows,</p>
  
  <pre><code>  public function regi_users(){
  $q = $this-&gt;db-&gt;query("SELECT username FROM public");
  
  return $q;
  }
  </code></pre>
  
  <p>and this i am accessing through a view i have created, to which, when admin logs in, he is redirected, as follows,</p>
  
  <p><strong>account.php</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" dir="ltr"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
  &lt;?php
  
    $this-&gt;load-&gt;model('loginmodel');
      $qresult = $this-&gt;loginmodel-&gt;regi_user();
  
      foreach ($qresult as $row) {
        echo $row-&gt;username;
      }
   ?&gt;
  
   &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>but when my admin logs in, he's shown the following error,</p>
  
  <blockquote>
    <p>Fatal error: Call to undefined method LoginModel::regi_user() in
    E:\wamp64\www\ci\application\controllers\account.php on line 11</p>
  </blockquote>
  
  <p>what am i doing wrong here? I apologize if it is a silly question but i am kind of new to php</p>
  
  <p>Thank you for your suggestions</p>