I am using code that looks something like this:
[php]
<?php
mysql_connect(" localhost", "xxxx_xx", "xxx") or die(mysql_error ());
mysql_select_db ("xxxx_xxx") or die(mysql_error ());
$query="SELECT Bloom_Name FROM ihs";
$result = mysql_query($qu ery);
echo '<select name="ihs" onchange="this. form.submit()"> ';
while($nt=mysql _fetch_array($r esult)){ //Array or records stored in $nt
echo '<option value="' . $nt['id'] . '">' . $nt['Bloom_Name'] . '</option>';
/* Option values are added by looping through the array */
}
echo '</select>'; // Closing of list box
?>
[/php]how do i get the id to store in my table instead of the name field displayed in Drop Down List
[php]
<?php
mysql_connect(" localhost", "xxxx_xx", "xxx") or die(mysql_error ());
mysql_select_db ("xxxx_xxx") or die(mysql_error ());
$query="SELECT Bloom_Name FROM ihs";
$result = mysql_query($qu ery);
echo '<select name="ihs" onchange="this. form.submit()"> ';
while($nt=mysql _fetch_array($r esult)){ //Array or records stored in $nt
echo '<option value="' . $nt['id'] . '">' . $nt['Bloom_Name'] . '</option>';
/* Option values are added by looping through the array */
}
echo '</select>'; // Closing of list box
?>
[/php]how do i get the id to store in my table instead of the name field displayed in Drop Down List
Comment