title: PHP (OOP) : Conditional not working as expected but no errors shown
body: <p><strong>My PHP knowledge level:</strong> Novice.</p>
  
  <p><strong>Learning resources:</strong> Codecademy, TheNewBoston, Wikipedia, PHP Documentation.</p>
  
  <p><strong>What I am trying to achieve:</strong> I am trying to learn how to work with object oriented PHP since I have read that is more efficient in the long term than procedural methods. I am trying to redirect users to the login.php page if the entered name and password match with the database and relogin.php upon fail.</p>
  
  <p><strong>The problem:</strong> I can't figure out why my conditional is not working as expected. It does work, otherwise I would have had an error message.</p>
  
  <p><strong>What I tried:</strong> Worked on the below code on scratch. I did a google search on the problem, tried to fix it by checking if any semicolons or brackets are missing, and even checked if my database connection could be established. It seems there are no errors so it means the conditional is only showing true.</p>
  
  <p><strong>Current error messages:</strong> No error messages on screen or in the source code which means the code is right but not working as expected.</p>
  
  <p><em>If you want me to comment the code please let me know.</em></p>
  
  <p><strong>My PHP code:</strong> </p>
  
  <pre><code>if(isset($_POST['name'])) {
      $name= $_POST['name'];
      $password = $_POST['password'];
      $login = new login($name, $password);
  }
  
  class Login {
  
      public function __construct ($name, $password) {
  
          if ($this-&gt;check($name, $password)){
              header("location:login.php");
          }
          else {
              header("location:relogin.php");
          }
      }   
  
      public function check ($name, $password) {
          $request = "SELECT `id` FROM `members` WHERE `name` LIKE '$name' AND ´password´ LIKE '$password'";
          $result = mysqli_query($connection, $request);
          return mysqli_num_rows($result) &gt; 0;
      }
  } 
  
          public function check ($name, $password) {
              $request = "SELECT `id` FROM `members` WHERE `name` LIKE '$name' AND ´password´ LIKE '$password'";
              $result = mysqli_query($connection, $request);
              return $result;
          }
      }
  
  **HTML code**
  
      &lt;form action="Login.php" method="post"&gt;
           &lt;input type="text" placeholder="Name" name="name"&gt;
           &lt;input type="password" placeholder="Password" name="password"&gt;
           &lt;input type="submit" name="button" value="Login"&gt;     
      &lt;/form&gt;
  </code></pre>