![]() |
Database Structure for a Poll
Hey,
I want to make a poll script to use on my website, on the front page and the user's profile page (they can make their own), but I can't think how I'd set out the database structure for one. I thought maybe having three tables:
Any help is appreciated, if you've wrote a poll script before, maybe you could share how you did you structure in the database. Thanks, - Chris |
I haven't made a poll script in a while, but I agree, even the ones I've done are sloppy, because they're just polls ;)
Here's how I'd lay it out... roughly.. Code:
MySQL:Hope that helps, I'll check back in later tonight to follow up with a little more. |
Hey,
Thanks for the idea. Look forward to seeing what else you have to say, if that's what you meant by "following up with a little more"... right now I need to go get my drink on! lol |
If each poll is only going to have one question then you don't need the poll_questions table. The question can go in the main poll table.
|
yeah that's a good point, guess i was just following the naming conventions.
2 points to eric. |
oh right, anyways. My point is that is a poll really something that requires a database design ? Unless your site is called 'Polls Unlimited - 1000s of polls for you' i dont think there's going to be any need to invest a lot of time into it.
Polls are generally used to gather a general opinion of a sites registered users. But say, your site is a revolving door of polls for people to vote on. Then I'd invest a little bit more time on breaking up the polls into categories and such. |
| All times are GMT. The time now is 10:25 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0