multi select box
hi to all
i need small help in php.
how to store multi select box values in database.suppose one person prefers 2 or 3 cities in a country.during the normal process last selected value is stored in database.but i want to store all selected values in multiple select box.
thanks in advance..
well, can't you store them in one field and separate them with comma ?
I think this is very easy.
Yes,i Want Tostore Values Seperated With Comma In A Single Fiels.plz Help Me.
consider the following code:
this gives the output:
$imploded = implode(",", $_POST['multiple_select']);
<form name="test" action="" method="post">
<select name="multiple_select" multiple size="3">
<input name="submit" value="submit" type="submit" />
The <select> item is turned into an array using the  brackets so that more than one item can be passed in the suber global $_POST.
[multiple_select] => Array
 => 4
 => 5
[submit] => submit
Using that you can then implode() the result into a comma separated string that you can then insert into your database.
If you need more help, post some code :)