I have two tables one tblEmployee and another tblCity.
The two tables are setup like this:
tblEmployee
-------------
employeeID
cityID
name
sex
contactNo
tblCity
-------------
cityID
cityName
I would like to create a form whereby an admin can update an employee’s details. The form has a drop down box which is populated by the cityNames in tblCity.
I am struggling coming up with a query to allow the admin to select one of these cities from the drop down which will update the employee’s cityID to the corresponding city in tblCity.
Many thanks in advance!
I suspect what you want is to setup the select values like this:
The
cityIDwill be submitted, and then you put that value in thetblEmployee.cityID.For example:
http://jsfiddle.net/5McA9/1/