I want a vote system like Digg.com in my database.
I want a vote system like Digg.com in my database. Need help to put in the VOTE part on the right spot in my ER- and relational diagram along with the right Crows notation.
Or maybe an explanation on how to think to accomplish this.
( I use PHP and MySQL. )
I want it so that only members can vote like how things work in Digg.com when you like or dislike a story.
The difference with my voting system is that I want to be able to get all the Positive and Negative votes and print it out and calculate the difference like so: http://tinypics.us/out.php/i5775_math02.gif
I just don't know what Datatype to use for this voting part and how to grab and sum up all the votes correctly?
Sounds dangerously like a homework assignment
Ok, here's my advice:
Think of it this way - one item/article/whatever can have many votes.
Use SQL - a simple function called Sum() should do the trick
As for your datatype - hwo ig is your voting scale? 0 to 10, -100 to 100, 1 to 1,000,000 etc etc.
For information on the T-SQL datatypes check this link