SWI03
05-07-2005, 05:10 AM
I have 3 tables
1st table has
county_id
county_name
state_id
2nd table has
state_id
state_name
state_abbr
3rd table has
id
first_name
last_name
county_id
state_id
email
and some other fields that are filled out in a form.
For the form, I get the state_name and county_name and put them in a dropdown box for each of them, but I would like to have it insert the id's for county and state in the 3rd table, or is it just not worth it to do that and just insert the state and county name? I've tried doing it but cannot seem to figure out how to convert the name to id and insert it in the database for the 3rd table. I am using php to put the info into the database.
1st table has
county_id
county_name
state_id
2nd table has
state_id
state_name
state_abbr
3rd table has
id
first_name
last_name
county_id
state_id
and some other fields that are filled out in a form.
For the form, I get the state_name and county_name and put them in a dropdown box for each of them, but I would like to have it insert the id's for county and state in the 3rd table, or is it just not worth it to do that and just insert the state and county name? I've tried doing it but cannot seem to figure out how to convert the name to id and insert it in the database for the 3rd table. I am using php to put the info into the database.