If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > I want a vote system like Digg.com in my database.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-18-07, 18:54
bankai bankai is offline
Registered User
 
Join Date: Jun 2007
Location: Sweden
Posts: 5
Question 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. )

1.)
A picture of my ER-diagram:
http://tinypics.us/out.php/i5773_tutorials02.gif

2.)
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?

3.)
Here's my Relational diagram
http://tinypics.us/out.php/i5776_relational01.gif

4.)
Picture of my Link tables:
http://tinypics.us/out.php/i5774_link01.gif

Last edited by bankai; 06-18-07 at 19:07.
Reply With Quote
  #2 (permalink)  
Old 06-21-07, 07:50
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Sounds dangerously like a homework assignment
Ok, here's my advice:
  1. Think of it this way - one item/article/whatever can have many votes.
  2. 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
HTH
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 06-21-07, 17:28
bankai bankai is offline
Registered User
 
Join Date: Jun 2007
Location: Sweden
Posts: 5
tnx.

(12345678910characters.)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On