By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,588 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Sending Multiselect List information to MySql

P: 3
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:
Expand|Select|Wrap|Line Numbers
  1. <select name="input3" size="5" multiple="MULTIPLE">
  2.     <option>LBS</option>
  3.     <option>SDS</option>
  4.     <option>MWC</option>
  5.     <option>KCF</option>
  6.     <option>THP</option>
  7.   </select>
  8.  
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
Jan 9 '12 #1
Share this Question
Share on Google+
3 Replies


Rabbit
Expert Mod 10K+
P: 12,347
Storing them in one row is a bad idea. It would denormalize your data and make it harder to query later on.
Jan 9 '12 #2

P: 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?
Jan 9 '12 #3

Rabbit
Expert Mod 10K+
P: 12,347
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.
Jan 9 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.