I have a basic customer entry form. 3 of the fields have select tags and pull data dynamically from other tables within a mysql database. For example, I am able to select an employee username (pulled dynamically from my employee table) from a dropdown list in my form. However, I'm not sure how to write a form to pull the data from the customer entry form and have the dropdown lists appear. I can get all the row data to appear when I use text fields for the form but the dropdown lists don't appear. I can get the dropdown list to appear but the rest of the update customer form is blank.
Following is what I use in the create customer form:
<?php
$db=mysql_connect("localhost","root","bonjovi");
mysql_select_db("airman");
$result=mysql_query("SELECT FROM employee order by employee_username",$db);
echo "<select name=\"employee_username\">\n";
while ($myrow=mysql_fetch_array($result)) {
echo ' <option value="'.$myrow["employee_username"].'">'.$myrow["employee_username"]."</option>\n";
}
echo " </select>\n";
?>
This is what I have for my update customer form:
<? $employee_username = $myrow["employee_username"];
$employee_username = ereg_replace( "(\n)", "<BR>", $employee_username ); ?>s>\n";
$db=mysql_connect("localhost","root","bonjovi");
mysql_select_db("airman");
$result=mysql_query("SELECT FROM employee order by employee_username",$db);
echo "<select name=\"employee_username\">\n";
while ($myrow=mysql_fetch_array($result)) {
echo ' <option value="'.$myrow["employee_username"].'">'.$myrow["employee_username"]."</option>\n";
}
echo " </select>\n";
?>
This will show the employee usernames in the dropdown but will not show the remainder of the values from the create form.
Any help would be great!
Barry