Jump to content

best table scheme for polls?


Atealtha

Recommended Posts

I took a look at the vBulletin source code and noticed that they seperate the questions and votes in only 2 columns.

 

Here is a visualization of the table in phpmyadmin:

 

question

q1|||q2|||q3...

 

and to the right of it there is:

 

votes

13|||2|||77...

 

they seperate their options with pipes. now, is this a good way to do polls? or is it better for me to go and put one poll option per row (with a seperate index which I\'ll organize myself)?

 

Or is there a way to put tables within tables to make this all easier that jelsoft and I don\'t know of?

Link to comment
Share on other sites

All design decisions like this involve tradeoffs. BBS polls are very simple because they can ask only one question, and then have a fixed set of answers that are always an enumerated list. Since they wanted to KISS, they used a compressed non-database centric structure. If your application was focused on polls, then this might be a bad decision, but since polls are essentially fluff in the context of a forum, it really doesn\'t matter. In their case they opted for a structure that is storage friendly but computationally taxing. This however allows them to focus on the forum code and be database agnostic which was probably one of their design goals.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.