title: Attempting to query a tagging object(many to many table)
body: <p>I have three tables that i am trying to query:</p>
  
  <p><strong>Mods</strong></p>
  
  <pre><code>mod_id
  author
  url
  name
  </code></pre>
  
  <p><strong>Tags</strong></p>
  
  <pre><code>tag_id
  tag_name
  tag_url
  </code></pre>
  
  <p><strong>tags_to_mods</strong>(mods &amp; tags have many to many relationship)</p>
  
  <pre><code>ttm_id
  tag_id
  mod_id
  </code></pre>
  
  <p>Essentially i am trying to find the tag_name and tag_id related to the given mod_id.</p>
  
  <p>How do i go about doing this? I am quite a newbie with SQL and have yet to attempt querying properly relational data like this. I assume that there is a better way to do it than what i have opted to go for.</p>
  
  <p>my attempt at this (in pseudo(ish) code):</p>
  
  <p><code>x = SELECT tag_id FROM tags_to_mods WHERE mod_id = $mod_id</code></p>
  
  <p><code>SELECT tag_name, tag_id FROM tags WHERE tag_id = x</code></p>
  
  <p>it gets the desired result but i have to query my table twice...</p>