gagards200 Posted September 14, 2010 Share Posted September 14, 2010 hello guyz..i have a little problem here.. I have two tables: 1. Employee Data 2. Sales Report Now each table has uniqued Id_Number, how can I make the Id_Number of the first table as the index to the second Table. Can u give me idea on how to do it during inserting of records... I know this very simple for some of you but still I need you help.. Thanks in Advance... Quote Link to comment https://forums.phpfreaks.com/topic/213406-how-to-index-id_number-of-one-table-to-another-table/ Share on other sites More sharing options...
fenway Posted September 15, 2010 Share Posted September 15, 2010 I think you're asking two separate things. 1) use last_insert_id() to get back the ID so that you can use it in subsequent statements. 2) Use FK constraints if you're serious. Quote Link to comment https://forums.phpfreaks.com/topic/213406-how-to-index-id_number-of-one-table-to-another-table/#findComment-1111373 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.