I'm still a virtual newbie when it comes to PHP, but I have been able to teach myself a thing or two from reading tutorials, etc. Anyhow, I'm now stuck and not sure how to create a looped insert.
Below is my code to dynamically create 11 selects named 1 through 11. These selects are rankings for 11 teams and what I'm wanting to happen is the user will rank the 11 teams and then submit the votes.
Since my votes table stores each rank as an individual record, I'm not sure how I should loop through to store each select as it's own record. Any ideas or helpful pushes would be great!
<?
$place = 1;
while ($place < 12) {
$query = "select * from team";
$result = mysql_query($query);
echo ("<tr><td>$place.</td>");
echo ("<td><select name=\"$place\">");
while($row = @mysql_fetch_array($result, MYSQL_ASSOC))
{
echo ("<option value=\"{$row['teamid']}\">{$row['teamname']}</option>");
}
echo ("</select></td><tr />");
$place++;
}
?>