title: Finding Related Tags
body: <p>I'm making a website with specific posts that have tags created by the user.  My database looks like this:</p>
  
  <pre>
  Qid              Tag
  3                Happy
  3                Sad
  3                Funny
  6                Happy
  6                Delicious
  8                Angry
  </pre>
  
  <p>What I want to do is to find related tags.</p>
  
  <p>My plan is to enter a tag as the key (say <code>Happy</code> for example) and then come out <code>Sad</code>, <code>Funny</code>, and <code>Delicious</code>.</p>
  
  <p>But I only want a max of say 5 or 6.</p>
  
  <p>In the real database, there are tons more of these entries, but i don't know how to choose between the top 5 or 6.</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>How would i do the query properly to just come up with all related tags?</li>
  <li>How would i narrow my best search results to 5 or 6?</li>
  <li>Is there an even better way to do related tags that i haven't thought of (e.g., dictionary)?</li>
  </ol>
  
  <p>BTW, it's in PHP so I can do post processing there, too.</p>