title: mysql joining two table
body: <pre><code>table user:
  id_u*   f_name   l_name
  ----------------------
  1       andi     mitchel
  2       sarah    bench
  3       kirsty   larx
  
  table voucher:
  id_v*   id_user    id_target
  1       1          2
  2       2          3
  </code></pre>
  
  <p>quite confused how to join those table with two foreign keys</p>
  
  <pre><code>$db-&gt;query("SELECT * FROM voucher v 
  LEFT JOIN user u ON u.id_u = v.id_user
  LEFT JOIN user u1 ON u1.id_u = v.id_target
  WHERE .... ")
  </code></pre>
  
  <p>echoing while loop... and returns nothing??</p>
  
  <pre><code>while($r = $q-&gt;fetch_array(MYSQLI_ASSOC)) :
     echo  $r['u.f_name'];
     echo  $r['u1.f_name'];
  endwhile;
  </code></pre>