0

I have to create a registration form through which data will be entered into two tables one the profile table n other the address table. The problem is that i have to enter the address id of address table simultaneously into the profile table. now i dont know how to take the output of select query through which i retreive the address_id and insert it into the profile table.

4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by johnmarshel
0

Uhmm, so basically one profile can has multiple address link to it? that is your relation between both tables?

0

its like one table consists of user details n other table has address details. the add_id of the corresponding address of the user has to be entered in user detail table.

0

2 tables Profile & Address
Profile Contains Address_ID, lot more fields and Address Contains Address_ID,Address1,Address2

Select Address.Address1,Address.Address2 from Profile,Address where Profile.Address_ID = Address.Address_ID

hope that helps!

0

I have to create a registration form through which data will be entered into two tables one the profile table n other the address table. The problem is that i have to enter the address id of address table simultaneously into the profile table. now i dont know how to take the output of select query through which i retreive the address_id and insert it into the profile table.

You had problem that you put address_id in both table but when you retrieve that you selected a address_id from specific table you choose,when you fire a select query then mentioned a "select a address_id from a address;" if you want from profile then same query you fire instead of address you put profile table name,and you make a join for this table then you retrieve your answer.

Edited by johnmarshel: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.