Hi
The below code generates a table and a number of rows depending on the user input.
for ( $counter = 1; $counter <= $PlayerNo; $counter += 1)
{
echo "<tr><td align='center' valign='center'>";
echo $counter;
echo "</td><td align='center' valign='center'>";
echo '<input name="Score" type="text" size="3" maxlength="3">';
echo "</td><td align='center' valign='center'>";
echo '<input name="MembershipNo" type="text" size="7" maxlength="7">';
echo "</td><td align='center' valign='center'>";
echo '<input name="FirstName" type="text" size="15" maxlength="7">';
echo "</td><td align='center' valign='center'>";
echo '<input name="LastName" type="text" size="15" maxlength="7">';
echo "</td></tr>";
}
echo "</table>";
This works but I also need to fill the Points column. To do this I'm think an elseif would do it but I can't get it to work. (The $counter is the finishing postion of each player, the score is dependant on the players finishing postion)
the basic idea would be: (and yes I know this syntax is way out but you get the idea...hopefully)
If [$counter] = 1, then [Points] = 500
Elseif [$counter] = 2, the [Points] = 350
Elseif [$counter] = 3, then [Points] = 250
and so on 4=200, 5=150, 6=100, 7=75, 8=50.
Is an elseif statement the correct one to use, and if so where should I place it (I presume in a $variable then call that in the code I have above already is that right?)