how to insert values in mysql table using php
Posted: Wed Apr 08, 2009 4:55 am
Hi all,
I want to insert the values from php registration form in to mysql db using the foreign key,
Table structure,
Table1:
userid primary key autoincrement,
username
emailid
Table 2:
id
Phone number
Address
Fax
Foreign key(id) reference Table1(userid)
for inserting values into table2 i have to use the Table1's primarykey, Question is how to get the table1's primary key and insert into table2.
thanks in advance,
sridhar
I want to insert the values from php registration form in to mysql db using the foreign key,
Table structure,
Table1:
userid primary key autoincrement,
username
emailid
Table 2:
id
Phone number
Address
Fax
Foreign key(id) reference Table1(userid)
for inserting values into table2 i have to use the Table1's primarykey, Question is how to get the table1's primary key and insert into table2.
thanks in advance,
sridhar