Sending Multiselect List information to MySql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mjcaestecker
    New Member
    • Jan 2012
    • 3

    #1

    Sending Multiselect List information to MySql

    Greetings all,

    I've got a form that posts to a mysql server via php that has a multi select list. I want to know if it is possible to put multiple responses into one column of the database with the one list.

    for example, here's the html code in the form for the list:
    Code:
    <select name="input3" size="5" multiple="MULTIPLE">
        <option>LBS</option>
        <option>SDS</option>
        <option>MWC</option>
        <option>KCF</option>
        <option>THP</option>
      </select>
    I'd like to be able to send multiple of these selections to the database at the same time and store them in one column.

    Thanks for your help,

    -Martin
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Storing them in one row is a bad idea. It would denormalize your data and make it harder to query later on.

    Comment

    • mjcaestecker
      New Member
      • Jan 2012
      • 3

      #3
      thanks Rabbit. So if i dont want to do that, is it possible to store each one of those options in its on column of the database?

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        You don't really want to do that either. Storing them in one row in their own column is only a little better than storing them all in the same column. They really should be stored in its own row. One record for each choice.

        Comment

        Working...