I am trying to create a voting system like Stack Exchange. Should I create a table and insert values like following and then sum up the "vote" or there are some better ways to do this?
Table name: vote
id userid article_id vote
1 1001 12 1
2 1002 12 -1
3 1003 12 1
4 1002 10 -1
Table name: articles
article_id article_title article_content article_author
12 something something something
10 something something something
From the example above the total vote for the article 12
is 1+(-1)+1 = 1
total
column to my articles table, but do you think its a good idea to proceed with the way I mentioned above? Because my concern is if I use theVOTE
table , it continue to be filled up with huge number of rows. I guess you understand my problem. Please kindly let me know what would be your suggesting regarding this. Thanks :) – black_belt May 20 '12 at 15:27