0
PHP code.. To get user_ID from one table to another, and insert automatically into to that other table (after do the PK FK)
First of all I'm a noob beginner so I'm sorry for my stupid question.. I have 2 table in DB ,userlogin (user_ID as PK) and appointment (user_ID as FK) How to automatically insert the user ID PK to user_ID FK. After the user register (save data in userlogin table) then the user can login and submit appointment (data save in appointment table) 1:M relationship.
3 ответов
+ 3
Write the logic which will first insert data in first table and return the generated unique Id. Now insert that Id in second table.
0
Thanks
0
I'm using mysql, can u teach me how to do that in php. user_id : auto increment