0
Hi! How to populate a table with FK from a parent table, with mysql and PHP?
Hi, I an building a simple website in PHP and MySQL pdo database. I have created user registration form, login and I want to create a dashboard that user have to update some datails. I have 2 tables in my database, first to keep user-registration data and second table to keep other detalis that user have to upload in dashboard of website. I have linked 2 tables with foreign key. My question is how to insert values in second table and populate foreign key column with values of first table in this case user_id in first table to relate with FK in second table? (I have implement session) Thanks!
2 ответов
+ 1
Thank you!
0
Select user_id from firstTable where ... Result of this in php variable and then you can Isert into secondTable Values...