Then how can you be sure the value exists in the respective tables?
Originally Posted by seannie
If you want to give the user the possibility to add any value, then there's no need for foreign keys and other tables.
If you want them to choose one of the existing values from the type, dept or sect table, then just load those values in a select box, and put the foreign key in the value property of the option, like this:
This way, in your script you'll already have the foreign key value.
<option value="key1">value 1</option>
<option value="key2">value 2</option>
<option value="key3">value 3</option>