title: PHP only showing three of the four messages
body: <p>I think I'm just missing the problem...</p>
  
  <p>If I run this code it is supposed to show "username already exists" if there is already a username equal to what the user enters.</p>
  
  <p>But so far, it only shows "successfully registered", "Please try again!" or "please fill all values" but it never shows "username already exists".. what do I have wrong here?</p>
  
  <pre><code>&lt;?php
  
  $username = $_GET['username'];
  $password = $_GET['password'];
  
  if($username == '' || $password == ''){
       echo 'please fill all values';
  }
  else{
       require_once('dbConnect.php');
       $sql = "SELECT * FROM HL WHERE username='$username'";
  
       $check = mysqli_fetch_array(mysqli_query($con,$sql));
  
      if(isset($check)){
            echo 'username already exists';
      }
      else{ 
           $sql = "INSERT INTO HL(username,password) VALUES('$username','$password')";
           if(mysqli_query($con,$sql)){
              echo 'successfully registered';
           }else{
              echo 'Please try again!';
           }
      }
  mysqli_close($con);
  }
  </code></pre>