Hey everyone, its me again. Got another situation where I am rather stuck and cant get my head around what I am doing wrong.
I am using the following code to populate one of 6 selection boxes in my form:
Code:
echo "<tr>";
echo "<td align='center' valign='middle'><select name='p1'>\n";//p1
while ($row1 = mysql_fetch_array($cmb1))
{
if ($row1['t_id'] = $row['team1'])
{
echo "<option value='$row1[name]'>" . $row1['name'];
}
}
echo "</td>";
And it works fine, I am getting 4 values in the box to choose from. However when I try to process the data in the next step I cannot get the data of this box with POST. I think it comes through blank.
Here is the code I am using for processing:
Code:
$pl1 = mysql_query("SELECT p_id FROM players WHERE name='$_POST[p1]'") or die("Query failed with error: ".mysql_error());
$row = mysql_fetch_array($pl1);
mysql_query("UPDATE games SET p1='$row[p_id]' WHERE g_id='$_POST[g_id]'") or die("Query failed with error: ".mysql_error());
Thanks for any advise.
bodis