473,700 Members | 2,582 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 15889
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
1505
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
13066
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
11579
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
1792
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
1572
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
1135
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
3907
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
18144
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
8728
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8647
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8974
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
7813
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
6563
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
5903
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
4404
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
3092
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
3
2030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.