Hello All,
I am trying to populate two drop down menus (primary support contact, secondary support contact) with the same information from 1 table(listing all of the support contacts available) .... I have the 1st menu working fine but Istill can't get the second one popultatin after several attempts. When the page loads there is a second menu however the options are blank!! I believe I can use the same to sql statement to populate both menus simulataneously but haven't figured it out.. I have also tried two different sql statements grabbing the same info but I think this is redundant? Below is my code.. any help or tips would be greatly appreciated!! Thanks
<HTML>
<BODY>
<CENTER><B> Insert A </B></CENTER>
<?php
include file
include ("magops_info.php");
$sql="SELECT mag_ID, name FROM mag_op";
$mysql_result=mysql_query($sql,$connection);
$num_rows=mysql_num_rows($mysql_result);
if ( $num_rows == 0 ) {
echo "Sorry there is no information";
} else {
we have records
echo "<FORM METHOD=GET ACTION=\"insert_it.php\">";
echo "What is the site<BR> <INPUT TYPE=\"TEXT\" NAME=\"f_site\" VALUE=\"$f_site\"><BR>";
echo "What is the address<BR> <INPUT TYPE=\"TEXT\" NAME=\"f_address\" VALUE=\"$f_address\"><BR>";
echo "What is the country <BR><INPUT TYPE=\"TEXT\" NAME=\"f_country\" VALUE=\"$f_country\"><BR>";
echo "Please select primary support contact <BR>";
echo "<SELECT NAME=\"f_magop\">";
while ($row=mysql_fetch_array($mysql_result))
{
$f_magop=$row["name"];
display results
echo "<OPTION>$f_magop";
}
echo "</SELECT><BR>";
echo "Please select secondary support contact <BR>";
echo "<SELECT NAME=\"f_magop2\">";
while ($row=mysql_fetch_array($mysql_result))
{
$f_magop2=$row["name"];
display results
echo "<OPTION>$f_magop2";
}
echo "</SELECT><BR>";
}# end else
echo "<BR><BR>";
echo "<INPUT TYPE=\"SUBMIT\" VALUE=\"Insert the record !\">";
echo "</FORM>";
echo "<FORM METHOD=GET ACTION=\"$PHP_SELF\">";
echo "<INPUT TYPE=\"SUBMIT\" VALUE=\"Clear me!\">";
mysql_close($connection);
?>
</FORM>
</BODY>
</HTML>