Hi barnes,
consider the following code:
PHP Code:
<?php
echo '<pre>';
print_r($_POST);
echo '</pre>';
$imploded = implode(",", $_POST['multiple_select']);
echo $imploded;
?>
<form name="test" action="" method="post">
<select name="multiple_select[]" multiple size="3">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
</select>
<input name="submit" value="submit" type="submit" />
</form>
this gives the output:
Code:
Array
(
[multiple_select] => Array
(
[0] => 4
[1] => 5
)
[submit] => submit
)
4,5
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.
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
Bookmarks