title: foreign key how to use join with 3 tables
body: <p>Im trying to make an list off all users registered to a specific cursus i've been looking into the join query but i cant figure out how it works and everything ill try is not working so far. this is what i have so far:       </p>
  
  <pre><code>      &lt;?php
          $cursus2 = mysqli_fetch_array(mysqli_query($con, "SELECT * FROM cursus JOIN Cursist"));
          $result = mysqli_query($con, $cursus2);
          $amount = mysqli_affected_rows($con);
  
          for ($i = 0; $i &lt; $amount; $i++) {
            $Cursist = mysqli_fetch_array($result);
  
          echo $Cursist['username']. "&lt;br /&gt;";
        }?&gt;
  </code></pre>
  
  <p>I want an output off all the usernames that are connected with the cursus in the bridge table.</p>
  
  <p>DB structure:</p>
  
  <pre><code>**Cursist Table**     
  -------------
  id    username
  -------------
  1     name1
  2     name2
  3     name3
  4     name4
  
  **cursus Table**
  -------------
  id    name
  -------------
  1     PHP
  2     JAVA
  3     HTML
  4     RUBY
  
  **Bridge**
  -------------
  Cursus_cursusCode    Cursist_id
  -------------
  1     1
  1     2
  1     3
  1     4
  2     1
  2     2
  3     3
  3     4
  4     1
  4     2
  </code></pre>
  
  <p>the query that was closed is this one i think:</p>
  
  <pre><code>SELECT * FROM cursus 
  JOIN cursist ON cursist.id=cursus.cursus_cursusCode 
  </code></pre>