title: Linking tables in mysql
body: <p>I need to know how to link two tables in a php/mysql set up then rank the results?<br/>
  Here is my situation.</p>
  
  <p>I have a stories table:<br/></p>
  
  <pre><code>storyid
  writerid
  title
  story
  submitdate
  </code></pre>
  
  <p>and a votes table</p>
  
  <pre><code>voteid
  userid
  storyid
  vote
  </code></pre>
  
  <p>I store a vote up as a 1 and a vote down as a -1<br/>
  I am looking for a way to join these two table then rank/sort the stories by the number of votes they recieve. <br/>
  I am open to any ideas about how to do so or a different possible database schema.</p>