title: Fatal error: Uncaught Error: Class 'User' C:\xampp\htdocs\gallery\admin\includes\admin_content.php on line 23
body: <p>This is from User.php File</p>
  
  <pre><code>&lt;?php 
  
  class User {
  
      public static function find_user_by_id($user_id) {
  
          global $database;
          $result_set = $database-&gt;query("SELECT * FROM users WHERE id=$userid");
          $found_user = mysqli_fetch_array($result_set);
          return $found_user;
      }
  }
  ?&gt;
  </code></pre>
  
  <p>This is from admin_content.php In this page I am getting an error.</p>
  
  <pre><code>&lt;?php 
      $found_user = User::find_user_by_id(2); // This is line 23
  
      echo $found_user["username"];
  ?&gt;
  </code></pre>
  
  <p>This is the error I am getting.</p>
  
  <blockquote>
    <p>Fatal error: Uncaught Error: Class 'User' not found in C:\xampp\htdocs\gallery\admin\includes\admin_content.php:23 Stack trace: #0 C:\xampp\htdocs\gallery\admin\index.php(24): include() #1 {main} thrown in C:\xampp\htdocs\gallery\admin\includes\admin_content.php on line 23</p>
  </blockquote>