Hi. I'm trying to make a database for storing the results of our weekly doubles match in tennis. I have to associate four names (two from each team) with two or three scores depending on how many sets we play. I'd like to set up a form with drop-down menus for the players and the scores. I thought I'd put the different drop-downs in different cells of a table. I'd like to use the first drop-down to pick the first player from an array (which isn't hooked up to a database yet, I'm just starting to work on the interface). The second, third and fourth drop-downs would have the remaining players,respectively, to choose from. This is my first php project and I can't even get the easy stuff to work. I'm getting an error on the "for" conditional statement and I can't figure out why.
Thanks, Frank
The error I get is: "Parse error: parse error, expecting T_VARIABLE' or'$'' in /home/..."
<?php
$player[] = array("Paul", "Peter", "Bill", "Van", "Frank", "Dave", "Ken", "Brian");
?>
<form action="" method="post" name="tennis_records" target="_self">
<table width="90%" border="0">
<tr>
<td><div align="center">TEAMS</div></td>
<td><div align="center">SET 1</div></td>
<td><div align="center">SET 2</div></td>
<td><div align="center">SET 3</div></td>
</tr>
<tr>
<td><select name="player1">
<?php
for ( $i=0; $i< 50 ; $i=++)
{
echo "<option>$player[$i]</option>" ;
}
?>
</select> </td>
<td><select name="score_a">
</select> </td>
<td><select name="score_c">
</select> </td>
<td><select name="score_e">
</select> </td>
</tr>
<tr>
<td><select name="player2">
</select> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><select name="player3">
</select> </td>
<td><select name="score_b">
</select> </td>
<td><select name="score_d">
</select> </td>
<td><select name="score_f">
</select> </td>
</tr>
<tr>
<td><select name="player4">
</select> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>