![]() |
![]() |
||||||
|
|||||||
| Tags: database, inserting, multiple, select |
![]() |
|
|||
|
I've never had to deal with this before and now have a client that wants to
have a multiple select field inserted into a database along with a mirad of other fileds. How is this typically dealt with? I have set the multiple option to work, but only one of the selected fields are inserted. Thanks |
| Sponsored Links |
|
|||
|
Does no one understand this question? Did I not make myself clear?
Just wondering as I am sure this is something that is done often. Let me give an example. I need to collect info in reagrds to the person's contact info, first name, last naem, email, etc. Then I need something like professional experience (choose all that apply): Computers, Banking, Human Resourses, etc. etc. Everything is inserted except only one if the mulitple select fileds is inserted. Any ideas? |
|
|||
|
On Wed, 23 Jul 2008 13:53:16 +0000 (UTC), "VernMan"
<webforumsuser@macromedia.com> wrote: >Does no one understand this question? Did I not make myself clear? It's done differently depending on what scripting language you're using. Since you didn't specify, it's not really possible to answer. Gary |
|
|||
|
On Thu, 24 Jul 2008 11:48:14 +0000 (UTC), "VernMan"
<webforumsuser@macromedia.com> wrote: >Well I am using php, sorry I negelected to mention that. ![]() In that case, you need to name the select so that PHP will treat it as an array. You do that by naming it with square brackets on the end of the name: <select multiple="multiple" name="whatever[]"> Then, in your PHP code that processes the form, join the array elements. For example, this will give you a comma separated list: $whatever=join(', ',$_POST['whatever']); Insert $whatever into your database. Gary |
|
|||
|
Thank for your response that worked great.
Now that I have the data inserted into the datbase I need to have a way to have each of those items selected on an update form whem multiple items are submited. To be clear, now I have a field in the database called 'sources' and in that field is the following data: 'self, partner, family, loan'. On an update form I have a menu that I want each item selected. How do I achieve that? Thanks |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise