Hi All
I have retrieve data from a mysql database into a form. I amend the details and the update the database with the new information
In the form I have a number of dorpdown forms that are populated by retrieving info from the data base.
I need the dropdown to display the selection that was made and stored in the database
here is how I create the dropdowns
// supplier
$resultsp = mysql_query("SELECT ACCNO,ACTYPE,NAME,ACTIVE,EXCODE FROM fin_accounts where ACTIVE='Y' and ACTYPE='C' and EXCODE>'00' ");
while ($rowsp = mysql_fetch_array($resultsp))
{
$d_supplier .="<option value =".$rowsp['ACCNO'].">".$rowsp['NAME']."</option>\n";
}
//create form
$form_po_edit ="<form action=\"$self\" method=\"post\">";
$form_po_edit .="<table border=\"1\" cellpadding=\"2\" width = \"600\">";
$form_po_edit .="<TR>";
$form_po_edit .="<TD width = \"250\">Supplier </TD><TD width = \"350\">
<select name=\"supplier_code\">
echo($d_supplier)
</select></TD>";
$form_po_edit .="</TR>";
$form_po_edit .= "</table>";
$form_po_edit .="<BR>";
$form_po_edit .="<input type=\"submit\" value=\"Submit\">";
$form_po_edit .="</form>";
echo ($form_po_edit);
This is just and extract of one of the drop downs, I have 20 fields and 5 dropdowns in the form
Thanks for the help
Martin