title: one database works and second doesnt
body: <p>I have a database and in it i have 4 tables, 2 for the private user and 2 for the business user. for some reason when I try to log in using the email of the business user it doesnt work but the username works, and in the private tables it works, here's my code if i didnt explain it properly tell me and ill try my best to explain it again</p>
  
  <pre><code>    $password = $_POST['password'];
      $emailuser = $_POST['unameemail'];
      $password = mysqli_real_escape_string($sql , $password); 
      $emailuser = mysqli_real_escape_string($sql , $emailuser); 
      $pwcheck = "
      SELECT * FROM private AS p 
      INNER JOIN user_private_data 
      AS c ON p.id = c.id 
      WHERE username='$emailuser' OR email='$emailuser'"; // part that works fine 
      $resultcheck = mysqli_query($sql , $pwcheck); // part that works fine 
      $rowcheck = mysqli_fetch_array($resultcheck , MYSQLI_ASSOC); // part that works fine 
      $hash = $rowcheck['password']; // part that works fine 
      $hash_pwd = password_verify($password , $hash);
      if ($hash_pwd != 0) {
          $_SESSION['username'] = $rowcheck['username']; // part that works fine  
          $_SESSION['logged'] = true; // part that works fine 
          header("refresh:0;url=../blablabla.php");     // part that works fine                   
      } else {
          $privateuser = "
          SELECT * FROM business AS d 
          INNER JOIN user_business_data 
          AS j ON d.id = j.id 
          WHERE username='$emailuser' OR email='$emailuser'"; // doesn't work
          $resultprivate = mysqli_query($sql , $privateuser); // doesn't work
              $rowprivate = mysqli_fetch_array($resultprivate , MYSQLI_ASSOC);
          $hashprivate = $rowprivate['password'];
          $hash_private = password_verify($password , $hashprivate);
          if ($hash_private != 0) {
  
              $_SESSION['username'] = $rowprivate['username'];
              $_SESSION['logged'] = true;
              $_SESSION['business'] = $rowprivate['bname'];
              $_SESSION['type'] = 'business';
  } 
  </code></pre>