in reply to Perl or Mysql to store multiple choices?

Personally, I would recommend using separate rows. Compressing your data into a string will defeat your ability to make ad-hoc queries on the database. Trust me on this - when one day your PHB wants to see the data in a different manner than you describe, you'll be happy you did.

  • Comment on Re: Perl or Mysql to store multiple choices?

Replies are listed 'Best First'.
Re^2: Perl or Mysql to store multiple choices?
by punch_card_don (Curate) on Mar 30, 2007 at 11:54 UTC
    At the risk of being a flip-flopper, yes, this consideration came to me in the night. If I do the string compression, then some day when we want, for example, to do stats on how many people chose option x, then I'll have to select the entire database and parse out the answers myself.

    OK, I'm sold.




    Forget that fear of gravity,
    Get a little savagery in your life.
      I agree, that you should use individual columns for all data. If you ever need specfic data out you then have to process the entire string and split it out. You will save yourself a lot of time by setting it up right the first time rather than wishing you had done it that way the first time.