title: php mysql join 3 tables
body: <p>Im looping through a feedback type comment system on a users page, finding the latest 6 posts.</p>
  
  <p>To display the post how I want, I have to grab data from 3 tables.</p>
  
  <p>I figure it'd be less db intensive if it was all pulled in one query, but I'm not sure how to write it, being suck at JOINs and things.</p>
  
  <p>This is my existing code</p>
  
  <pre><code>$sql_result = mysql_query("SELECT * FROM feedback WHERE user='1' ORDER BY date desc LIMIT 6", $db);
  while($rs = mysql_fetch_array($sql_result)) {
  
     $sql_result2 = mysql_query("SELECT * FROM members WHERE id= '$rs[author]'", $db); 
     $rs2 = mysql_fetch_array($sql_result2);
  
     if ($rs2[clan] != 0) { 
        $sql_result3 = mysql_query("SELECT * FROM clans WHERE id= '$rs2[clan]' LIMIT 1", $db);
        $rs3 = mysql_fetch_array($sql_result3);
  
       // write comment
  </code></pre>
  
  <p>Can someone give me a clue?</p>