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 Link to comment https://forums.phpfreaks.com/topic/196592-how-to-tell-if-someone-has-voted/ 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. Link to comment https://forums.phpfreaks.com/topic/196592-how-to-tell-if-someone-has-voted/#findComment-1032185 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. Link to comment https://forums.phpfreaks.com/topic/196592-how-to-tell-if-someone-has-voted/#findComment-1032208 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. Link to comment https://forums.phpfreaks.com/topic/196592-how-to-tell-if-someone-has-voted/#findComment-1032213 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. Link to comment https://forums.phpfreaks.com/topic/196592-how-to-tell-if-someone-has-voted/#findComment-1032215 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? Link to comment https://forums.phpfreaks.com/topic/196592-how-to-tell-if-someone-has-voted/#findComment-1032218 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.