Hello, A question about forms and PHP. I have a dropdown list which gets the lines in the list from DB. Like this(col1 is used only for sorting the data):
echo "<td>choose one:</td><td><SELECT NAME=\"name1\">"; $sql="SELECT col1, col2 FROM table_04 ORDER BY col1"; $result=mysql_query($sql); $num = mysql_num_rows($result); $counter = 1; while ($num >= $counter) { $row = mysql_fetch_array($result); $col2 = $row["col2"]; echo "<option value=\"name\">$col2</option>"; $counter++; } This obviously leaves the value of $col2 to what ever is in the last row in database. How do I set the script to change the value when user selects another name from the list? I need to do more stuff based on the users selection. How do I get the selection from the list to a variable? I haven't really done forms and PHP before ;-) Thanks Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php