Jump to content

multiple select


Recommended Posts

So I have created the following form in PHP/HTML:

$query = "SELECT * FROM STATUS ORDER BY status";$result = mysql_query($query)  or die ("Couldn't execute query.");echo "	<td><select multiple size='10' name='status'>\n";while ($row = mysql_fetch_array($result))	{	extract($row);	echo "<option value='$status'>$status\n";	}echo "</select></td>\n";

now note that I am using "multiple" in the html select statement. Since this form data is collected via a POST with a name of 'select', how do I retrieve ALL of the items that were selected? Right now when I pick up the $_POST['status'] variable it only results in the last item selected. I'm sure there is an easy answer, I just can't seem to figure this out as I am a begining programmer. Thanks! drb

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...