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... 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. 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
Archived
This topic is now archived and is closed to further replies.