I have an issue with a drop down menu that I am hoping you all can help me with. The issue is when I press "Submit", my code prints back values from a form I developed (eventually I will write them to a database). In this form, I have a dynamically built drop down (php/ mysql query). No matter which value I select, it always prints the LAST row in the table (array) as the selected value. My code follows:
1) I connect to database
2) I am building a set of forms using a loop statement where the variable '$a' increments by one each time through the loop.
3) I run code to get drop down array
4) The web page for reference is: http://theweekly13.com/test/gamebuilder.php
Thanks for any help.
Cheers!
Seth
1) I connect to database
2) I am building a set of forms using a loop statement where the variable '$a' increments by one each time through the loop.
3) I run code to get drop down array
Code:
$TVSQL = mysql_query("SELECT TVStation FROM NCF_tvstations");
echo "<form action=something.php method=POST>
<select name=TVStation[$a]>";
while ($r = mysql_fetch_array($TVSQL))
{ $TVStation[$a] = $r["TVStation"]; echo "<option
value='$TVStation[$a]'>$TVStation[$a]</option>"; }
echo "</select></td>";
Thanks for any help.
Cheers!
Seth
Comment