Adobe Dreamweaver Forums



Last 10 THreads :         Insert "Search" in a Topic (Last Post : jimpr - Replies : 2 - Views : 3 )           »          The "quality" setting (Last Post : davexnet - Replies : 1 - Views : 2 )           »          click-and-drag swf pages (Last Post : Adventures NW mag - Replies : 0 - Views : 1 )           »          advice please (Last Post : NedWebs - Replies : 3 - Views : 4 )           »          Before I cry I thought I would ask.... (Last Post : Erik L. **Community Expert** - Replies : 1 - Views : 2 )           »          PROBLEMS WITH FLASH WEBSITE (Last Post : Alix86 - Replies : 0 - Views : 1 )           »          Problem with 10.0.12.36 (Last Post : CheyenneDonna - Replies : 0 - Views : 1 )           »          cross-browser problem with CSS margin-bottom (Last Post : malcster2 - Replies : 1 - Views : 2 )           »          IE7 Screws my Layout (puts gun in mouth) (Last Post : MaskedMan69 - Replies : 4 - Views : 5 )           »          ANN: Contact Form Solution Pack (Last Post : Joseph Lowery - Replies : 9 - Views : 10 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Dreamweaver: Main > Dreamweaver Application Development
 
Tags: , , ,



Reply
  #1 (permalink)  
Old 07-21-2008, 02:41 PM
VernMan
 
Posts: n/a
Diggs:
Default Inserting Multiple Select Into Database

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



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-23-2008, 03:42 PM
VernMan
 
Posts: n/a
Diggs:
Default Re: Inserting Multiple Select Into Database

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?



Reply With Quote
  #3 (permalink)  
Old 07-24-2008, 06:58 AM
Gary White
 
Posts: n/a
Diggs:
Default Re: Inserting Multiple Select Into Database

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
Reply With Quote


  #4 (permalink)  
Old 07-24-2008, 01:55 PM
VernMan
 
Posts: n/a
Diggs:
Default Re: Inserting Multiple Select Into Database

Well I am using php, sorry I negelected to mention that.
Reply With Quote
  #5 (permalink)  
Old 07-24-2008, 04:08 PM
Gary White
 
Posts: n/a
Diggs:
Default Re: Inserting Multiple Select Into Database

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
Reply With Quote
  #6 (permalink)  
Old 08-21-2008, 03:12 PM
VernMan
 
Posts: n/a
Diggs:
Default Re: Inserting Multiple Select Into Database

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

Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 09:18 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk