473,396 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

inserting values from a multiple selection list menu using dreamweaver php

hello am a relative newbie to php. am using dreamweaver,php/mysql. i want to populate a mysql field using a multiple selection list menu. i have been to countless forums and so far nothing. can somebody please please help me. i want to insert the multiple selections into one column. i will really appreciate any response
Feb 23 '07 #1
2 8688
Motoma
3,237 Expert 2GB
hello am a relative newbie to php. am using dreamweaver,php/mysql. i want to populate a mysql field using a multiple selection list menu. i have been to countless forums and so far nothing. can somebody please please help me. i want to insert the multiple selections into one column. i will really appreciate any response
Welcome to theScripts.

It sounds to me like what you are trying to do is have one entry in MySQL have multiple entries of an HTML element.
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO htmlTable (htmlCode) VALUES ("<select><option>option1</option><option>option2</option></select>")
  2.  
Let me be the first to say, this is not how databases are designed to be used: it is an nearly useless, and quite ineffective way of dealing with data.

If this is not what you are trying to accomplish, and I have misunderstood you, please post back describing your situation a little more thorougly.
Feb 23 '07 #2
ronverdonk
4,258 Expert 4TB
Assuming the (multiple) select box name is 'list[]', you can use the implode() function to create a string of values from the POSTed 'list' array, separated by a value, in this sample a comma. You can now insert $string in your MySQL table column.

[php]
if (isset($_POST['list'])) {
$string = implode(",", $_POST['list']);
echo $string; // $string contains all values sep.by a comma
exit;
}[/php]

Ronald :cool:
Feb 23 '07 #3

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

Similar topics

18
by: booner | last post by:
I have a form that when it loads I would like to highlight the values (from a DB) that have been selected in a multiple selection list (<select multiple="true">. function onLoad() {...
1
by: pmud | last post by:
I have an ASP.NET web application using C# code. I am trying to insert values from a web form into an SQL database. I am using SQL COMMAND object for this. I need to know HOW TO INSERT THE RADIO...
1
by: VbUser25 | last post by:
hi.. i have a drop-down menu with a list of products.when i select any one product i open a popup displaying hte product categories in it.i then enter the no. of items i want.and finally when i...
2
by: bienwell | last post by:
Hi all, I've got a problem with getting the data values from multiple selections in the list box. I could only get the value and the index of the first item from the selection, but not the...
5
by: Bubba | last post by:
I have a dynamic pulldown list (ASP with javascript) that when a user picks a state, the corresponding counties for that state appear in a dynamic second pulldown list. When I submit the form, the...
1
by: Zak | last post by:
Hello, I need some help trying to grab the data selected from a checkboxlist. The checklist is acting like a menu. The first selection is accepted but not the multiple ones. For example is the...
10
by: jmartmem | last post by:
Greetings, I have an ASP page with a 5x5 table embedded inside an Insert Record Form. This table contains several fields (mostly drop down list menus) and is used for corporate timekeeping (users...
5
by: jmartmem | last post by:
Greetings, I am using Dreamweaver CS3 to design an ASP page that contains an Insert Record Form. Within this form are two list/menu form fields that I would like to "synchronize". In other words,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.