I want to complete user sign up. firstly user will write username and password, table called users, I have id as primary key. secondly user will write address, phone number and zipcode, table called userdata, I have userid as index(key). I have did a relation between id from table user and userid from table userdata.
So now I want to insert data from php code I did two forms one for user and it has two input for username and password it works well and data inserted.
in the second form I have select option has id from table users and it works well. then in the same form I have three inputs phone number, address and zipcode. so the question is how I can insert the data to userdata by the same to the same id. so userid in table user will be the same id in table userdata.
I need sql code.
I used that :
"INSERT INTO userdata(address, phone, zipcode) VALUE (:address, :phone, :zip) SELECT 'id' FROM 'users';"