473,609 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php/mysql multiple select list box(beginner).

Dear group,
I have a task where I have to fetch datas from mysql and display it
in the multiple select list box. I have fetched the datas and it is
getting diplayed correctly in the multiple select box. I have used
some thing like this.

print "<select MULTIPLE SIZE='6' name='db_test[]'>";
while($row = mysql_fetch_obj ect($handle))
{

if($num 0) /*num is number of rows*/
{
print "<option value='$row->db_name'name=' $row->db_name'>".$ro w
>db_name."</option>";
}
}
print "</select>";

But I want to insert in mysql the selected values.That too the
multiselect in mysql. Do i have to use serilize function? Any link or
any implimentation snipits is very help full. Any key word to search
the google..? Thanks for any help.

May 10 '07 #1
2 15886
sathyashrayan wrote:
Dear group,
I have a task where I have to fetch datas from mysql and display it
in the multiple select list box. I have fetched the datas and it is
getting diplayed correctly in the multiple select box. I have used
some thing like this.

print "<select MULTIPLE SIZE='6' name='db_test[]'>";
while($row = mysql_fetch_obj ect($handle))
{

if($num 0) /*num is number of rows*/
Why are you checking the number of rows? If none were returned, you
won't get here, anyway).
{
print "<option value='$row->db_name'name=' $row->db_name'>".$ro w
>db_name."</option>";
}
}
print "</select>";

But I want to insert in mysql the selected values.That too the
multiselect in mysql. Do i have to use serilize function? Any link or
any implimentation snipits is very help full. Any key word to search
the google..? Thanks for any help.
This part isn't clear. What exactly do you want to insert? Where do
you want to insert it?

Or an even better question - what are you really trying to accomplish?
Helping us understand that part will allow us to help you the best.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 10 '07 #2
sathyashrayan schreef:
Dear group,
I have a task where I have to fetch datas from mysql and display it
in the multiple select list box. I have fetched the datas and it is
getting diplayed correctly in the multiple select box. I have used
some thing like this.

print "<select MULTIPLE SIZE='6' name='db_test[]'>";
while($row = mysql_fetch_obj ect($handle))
{

if($num 0) /*num is number of rows*/
{
print "<option value='$row->db_name'name=' $row->db_name'>".$ro w
>db_name."</option>";
}
}
print "</select>";

But I want to insert in mysql the selected values.That too the
multiselect in mysql. Do i have to use serilize function? Any link or
any implimentation snipits is very help full. Any key word to search
the google..?
You could try:
database normalize

May 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1500
by: Jay | last post by:
Hi everybody ! I am a newbie here. I hope somebody will help with my problem. I am currently write a web-application that allow user to submit their job application online. In the job application, there is a section that ask the user to select the skills that apply to them. Each skill have an experience level associated with it. Below is example of the skills section:
1
13061
by: william cline | last post by:
Hi, I am a beginner and below I have code for a long in form. My goal is for the form to read a file of a list of users and thier passwords ....compare the text box inputs to the file and either start over or load the main file.... I attempted to use a slect case..but its not working for me.. If someone has a better way of doing it..I would apperciate the help. Thank you! Option Explicit Public LoginSucceeded As Boolean
1
11566
by: Ahmet Karaca | last post by:
Hi. myds.Reset(); mycommand.SelectCommand.CommandText= "Select att1 from Ing as Ingredient, Pro as Product "+ "where Pro.ad='apple' and Pro.id=Ing.id"; mycommand.Fill(myds, "Product"); // Here is the problem listbox.DataSource = myds.Tables.DefaultView; // Here again listbox.DataTextField = "invid"; // Here again listbox.DataBind(); mycon.Close()
4
1787
by: anonymous | last post by:
Hi Folks, I have a form with two Dropdown list boxes, which get loaded with data from Database. DropDownList1 gets data from Table1 and DropDownList2 gets data from Table2 Table1 has a parent child relationship with Table2 ( has a foreign key to Table1)
0
1570
by: odysseyphotography | last post by:
Hi, I'm trying to build a simple search for a database of jobs. Users can search using three groups of critera: 1) Area (check boxes) Buying and merchandising Design Executive
1
1132
by: girlfriday | last post by:
I am currently using the following code to paste data selected from a one column list box (using a form) into a specific range (column A) Range("A7").Select Dim i As Integer i = -1 'beginning of loop Do i = i + 1
27
3892
by: gerrymcc | last post by:
Hello, I'm a php/mysql beginner... Is there any way of making the mysql command line client full-screen? Sometimes it's easier to use the client than go thru php, but since it's only about 80 characters wide that limits its usefulness. Thanks, Gerard http://homepage.eircom.net/~gerfmcc]
3
1288
by: ventspacey | last post by:
Alright, I am a definate nube at mysql and I have a problem that I just cannot figure out. I am trying to integrate a CMS database 'forum' data to another CMS database forum. I pretty much have all the variable lined up, I just need to do one thing... Alright, say I have a two table example1 and example 2 I need to migrate the data from example 2 table to example 1 table but I need to match the data up alongside the data that currently...
22
18130
by: ddg_linux | last post by:
I have been reading about and doing a lot of php code examples from books but now I find myself wanting to do something practical with some of the skills that I have learned. I am a beginner php programmer and looking for a starting point in regards to practical projects to work on. What are some projects that beginner programmers usually start with? Please list a few that would be good for a beginner PHP programmer to
0
8567
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8527
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8215
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5509
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4015
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2529
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.