Inserting Data into 2 tables ( associating PK)
Posted: Tue May 27, 2003 4:52 pm
Hi everybody!!
I am newbie in PHP. We are running postgresql in our office. I am trying to figure out how I can insert information submited from a form into 2 different tables.
Its a employee information database, where the first table will hold emp Fname, lname and the 2nd table will hold the rest of the info. The DB is designed such a way because some employees work in 2 or more departments.
I want the ID which was created automatically in the emp table to be inserted in table 2 as a foreign key.
This is a one transaction insert.
I have been surfing a lot of sites to see if they have good eg.. but nothing came close..
Any help will be very much appreciated.
I am newbie in PHP. We are running postgresql in our office. I am trying to figure out how I can insert information submited from a form into 2 different tables.
Its a employee information database, where the first table will hold emp Fname, lname and the 2nd table will hold the rest of the info. The DB is designed such a way because some employees work in 2 or more departments.
I want the ID which was created automatically in the emp table to be inserted in table 2 as a foreign key.
This is a one transaction insert.
I have been surfing a lot of sites to see if they have good eg.. but nothing came close..
Any help will be very much appreciated.