Jump to content


Photo

Table structure help needed


  • Please log in to reply
1 reply to this topic

#1 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 17 June 2006 - 03:04 PM

Hi

I was making a poll thing, but I dont know what is the best way to store data...

Idea #1:

Table "polls":
fields: poll_id, poll_question, poll_options, poll_options_num_votes

being poll_options and poll_options_num_votes serialized arrays.

Idea #2:

Table "polls":
fields: poll_id, poll_question

Table "poll_options":
fields: poll_id_from, option_text, option_votes

Considering a that I may have potentially thousands of polls, thus maybe up to tens of thousands of options, what is the best option?

Thanks [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]
~ D Kuang

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 18 June 2006 - 03:13 AM

Closer to idea 2, for sure -- no serializing in a single column. And 1000s of records is not a problem at all.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users