gaimung wrote in php

Hello everyone,

This might seem like a stupid question to most of you but I'm a noob at this php mysql stuff. I know how the basics work and my current situation is something I've been trying to figure out the past two days.

So here is what I have...

A form with choices (ignore the textbox).


<form method="get" action="updateshift.php">
<input type="text" name="person">

<select multiple name="shift[]">
<option value="1">Day Shift</option>
<option value="2">Mid Shift</option>
<option value="3">Night Shift</option>
</select>

<input type="submit">
</form>


So lets say that someone selects multiple choices. I want to insert those choices into a database. Now, what I read was to use something like this:


foreach($_GET['shift'] as $shift)<br /> {
print $shift;
}


Supposedly, it should print out the values of what the user selects but then it says that I got an invalid argument. Sadly this isn't working. Any advice?