title: Rating System in PHP and MySQL
body: <p>If we look at the stackoverflow website we have votes. But the question is what is the bestway to store who has voted and who has not. Lets also simplify this even more and say that we can only vote Up, and we can only Remove the Up vote.</p>
  
  <p>I was thinking having the table to be in such form</p>
  
  <blockquote>
    <p><code>question - Id(INT) | userId(INT) | title(TEXT) | vote(INT) | ratedBy(TEXT)</code></p>
  </blockquote>
  
  <p>Thre rest is self explanitory but ratedBy is a Comma Seperated Id values of the Users.</p>
  
  <p>I was thinking to read the <strong>ratedBy</strong> and compare it with the <strong>userId</strong> of the current logged in User. If he dosent exist in the <strong>ratedBy</strong> he can vote Up, otherwise he can remove his vote. Which in turn will remove the value from <strong>ratedBy</strong></p>