Forum Moderators: coopster

Message Too Old, No Replies

Storing voting data

Seeing which user has voted on which proposal

         

iceman22

7:38 am on Mar 27, 2005 (gmt 0)

10+ Year Member



I am introducing a voting system and I can't figure out (well anyway) how to store the results of each proposal. Registered users can vote on proposals, this vote needs to be recorded somehow.

I'm guessing a list of users and their vote attached to the moderation somehow in the MySQL voting table, or alternatively attach to each user what they have voted on.

Either way I'm not sure how to add a list of users to a particular ID of an SQL row, the only way I can see doing that is having an array of users in a row, but I don't think MySQL supports arrays like that?

dmmh

8:01 am on Mar 27, 2005 (gmt 0)

10+ Year Member



its actually quite easy. 4 columns is all you need:
id
user id
proposal id
vote cast

:)

iceman22

10:27 am on Mar 27, 2005 (gmt 0)

10+ Year Member



I wasn't thinking that route but it's really easy, especially when getting data from the table.

Thanks

dmmh

8:56 pm on Mar 27, 2005 (gmt 0)

10+ Year Member



welcome :)