Hello,
I am designing my first serious web database application using php and mysql.
I have the following problem:
I have made a form inside a loop using POST method:
PHP Code:
print "<form method='POST' action='gamble.php' name='form1'>";
print "<table>";
$t=array();
while ($row = @ mysql_fetch_row($result))
{
$i=0;
foreach ($row as $data)
{
$t[$i]=$data;
$i++;
}
print "<tr>";
print "<td>\n<b>{$t[0]}</b></td>";
print "<td><input type='text' size='4' name='first_team' value='{$first_value}'></td>";
print "<td><input type='text' size='4' name='second_team' value='{$second_value}'></td>";
print "<td>\n<b>{$t[1]}</b></td>";
print "<td><font color='red'><b>Deadline:{$t[2]}</b></td>";
print "</tr>";
$h=array_merge($h,$t);
}
print "<tr>";
print "<Td><input type='submit' value='insert'></td>";
print "</tr>";
print "</table>";
print "</form>";
and in gamble.php file i use following method to get "first_team" and "second_team" from bet.php
PHP Code:
$first_value = $_POST['first_team'];
$second_value = $_POST['second_team'];
and ir only returns one value for each variable which is expectable. I want to define "first_team" and "second_team" variables in bet.php like an array so that I won't have any problem fo retrieving them.
I would br glad if you help me.