title: PHP SQL loop outputs as 0 rows
body: <p>I am trying to create a PHP loop to show the players the tournaments they are partaking in. I tried the function on phpMyAdmin, and I got the result that I wanted. But when I try to run this simple script on PHP, it outputs as 0 rows.</p>
  
  <p><img src="https://i.stack.imgur.com/iYYYq.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/obyZD.png" alt="enter image description here"></p>
  
  <p>index.php</p>
  
  <pre class="lang-php prettyprint-override"><code>chdir("../"); // path to MyBB
  define("IN_MYBB", 1);
  require("./global.php");
  
  if($mybb-&gt;user['uid']) {
      $sql = "SELECT * FROM players, tourneys WHERE players.forumname = 1 AND players.tid = tourneys.id";
      $result = mysqli_query($conn, $sql);
      // output data of each row
      if (mysqli_num_rows($result) &gt; 0) {
          // output data of each ro
          while($row = mysqli_fetch_assoc($result)) {
              $name = $row['name'];
              $date = $row['date'];
              $time = $row['time'];
              echo $name;
              echo $date;
              echo $time;
          }
      } else {
          echo "0 rows";
      }
  }
  </code></pre>