469,945 Members | 2,383 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,945 developers. It's quick & easy.

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_object($handle))
{

if($num 0) /*num is number of rows*/
{
print "<option value='$row->db_name'name='$row->db_name'>".$row
>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 15673
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_object($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'>".$row
>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*******@attglobal.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_object($handle))
{

if($num 0) /*num is number of rows*/
{
print "<option value='$row->db_name'name='$row->db_name'>".$row
>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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jay | last post: by
1 post views Thread by william cline | last post: by
1 post views Thread by Ahmet Karaca | last post: by
4 posts views Thread by anonymous | last post: by
reply views Thread by odysseyphotography | last post: by
27 posts views Thread by gerrymcc | last post: by
22 posts views Thread by ddg_linux | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.