title: Undefined function getTeam()
body: <p>So what I want to do is to show who's in a team. I've created a function called getTeam().</p>
  
  <pre><code>class admin
  {
      private $db;
  
      public function __construct($conn)
      {
          return $this-&gt;db;
      }
      public function getTeam($teamname)
      {
         try
          {
              $sql = "SELECT * FROM `tbl_players` WHERE EXISTS (SELECT id FROM `tbl_teams` WHERE team_name=:team_name)";
              $stmt = $this-&gt;db-&gt;prepare($sql);
              $stmt-&gt;bindparam(":team_name", $teamname);
              $stmt-&gt;execute();
              return $stmt;
          }
          catch(PDOException $e)
          {
              echo $e-&gt;getMessage();
          }
      }
  }
  </code></pre>
  
  <p>Here is my dbconnect I'm using</p>
  
  <pre><code>session_start();
  $DB_host = "localhost";
  $DB_user = "root";
  $DB_pass = "";
  $DB_name = "project_fifa";
  
  try
  {
      $conn = new PDO("mysql:host={$DB_host};dbname={$DB_name}",$DB_user,$DB_pass);
      $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  }
  catch(PDOException $e)
  {
      echo $e-&gt;getMessage();
  }
  include ('assets/classes/admin.php');
  $user = new admin($conn);
  </code></pre>
  
  <p>So now I'm trying to use the function here</p>
  
  <pre><code>require('../dbconnect.php');
  
  if(isset($_POST['findteam'])){
  $teamname = $_POST['teamname'];
  getTeam($teamname);
  }
  </code></pre>
  
  <p>It can't find the function and I don't know why.</p>