Hi All
I have data in a mysql database, I retrieve the data into a form and edit it and then resubmit the amended data into the database.
In the form I have dorpdown boxs that are populated by extract data from other tables in the database. I need ther dropdown box to show the info that was stored in the data bases when the form in loaded
this is how I create the dropdown and the form
------ connection info and database queies --------
// 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";
------ More dorpdowns Created----------
$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>";
}
----rest of form---
echo ($form_po_edit);
Thanks for the help
MArtin