I am having the hardest time retriving the value of my selection box.
Here is my selection code:
Then i try to send it to my database and it does not set the update, the values don't change.
is it my select box or not pulling the option. I tried a foreach loop but that did not work.
Here is my selection code:
Code:
echo "<form name='Set' method='post' action='Set_Team.php'>";
echo "<td>";
echo "<table border = '0'>";
while($row = mysql_fetch_array($data))
{
$ID = $row['ID'];
echo "<tr>";
echo "<td>";
echo $row['Player'];
echo "</td>";
echo "<td>";
echo "<select name='Status'>";
echo $row['Start_Sit'];
if($row['Start_Sit'] == "Start")
{
echo "<option value='Start' selected>Start</option>";
echo "<option value='Sit'>Sit</option>";
}
if($row['Start_Sit'] == "Sit")
{
echo "<option value='Sit' selected>Sit</option>";
echo "<option value='Start'>Start</option>";
}
echo "</select>";
echo "</td>";
echo "</tr>";
}
echo "</table>";
echo "<center>";
echo "<input type='submit' name='Set' value='Set Players' />";
echo "</td>";
echo "</tr>";
echo "</form>";
Then i try to send it to my database and it does not set the update, the values don't change.
Code:
$setquery="SELECT * from $TeamName";
$setdata=mysql_query($setquery);
while($setrow = mysql_fetch_array($setdata))
{
$Set=$setrow['ID'];
//echo $Set;
//echo $_POST[$Set];
$setquery2 = "UPDATE $TeamName set Start_Sit=$_POST[Status] where ID='Donovan McNabb'";
mysql_query($setquery2);
}
is it my select box or not pulling the option. I tried a foreach loop but that did not work.