Orionsbelter Posted March 26, 2010 Share Posted March 26, 2010 Hi there i'm making a small voting script for members. However i'm a bit stuck. Users get to vote on a poll but only once. However i'm having about 50 polls but do not know to to stop them for voting more than once. I heard of people using a text method to save all the polls IDs in one text type field in the database assigned to the members username. But i still don't really understand how i could do this could someone help me please Thanks for reading Quote Link to comment Share on other sites More sharing options...
trq Posted March 26, 2010 Share Posted March 26, 2010 You need a table called voted_on (or similar), then simply store a users id, and a poll id when a user votes on a poll. Quote Link to comment Share on other sites More sharing options...
Orionsbelter Posted March 26, 2010 Author Share Posted March 26, 2010 But wouldn't that mean a lot of infomation been put into the database? Wouldn't it be overloaded it? So as if there is 50 polls and 2000 members and each of them votes on each poll that is 100,000 inserts into that table. Also the polls will never get deleted nor the results. Quote Link to comment Share on other sites More sharing options...
ignace Posted March 26, 2010 Share Posted March 26, 2010 Also the polls will never get deleted nor the results. That is not a problem it will take a serious amount of time before you start noticing and even then you still have options like clustering and partitioning. Quote Link to comment Share on other sites More sharing options...
trq Posted March 26, 2010 Share Posted March 26, 2010 Your data needs to be stored somewhere and databases are designed to store data. Quote Link to comment Share on other sites More sharing options...
ignace Posted March 26, 2010 Share Posted March 26, 2010 Your data needs to be stored somewhere and databases are designed to store data. Plus would your text file be faster you think without it's indexes? Not to mention it's size? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.