louiscb Posted December 11, 2014 Share Posted December 11, 2014 Simple question but I couldn't find any straight forward answers. I have a customer details table with: customer ID, name, address, email. I also have an delivery table with delivery ID, customer ID, order ID. How can I link the customer ID column from the customer table to the delivery table so that when changes occur on the customer table they subsequently alter all other tables? I know it might use foreign keys but I couldn't find any online resource that explained how to use them properly. Cheers Link to comment https://forums.phpfreaks.com/topic/293028-how-to-link-a-column-in-one-table-to-another-table/ Share on other sites More sharing options...
Barand Posted December 11, 2014 Share Posted December 11, 2014 Use foreign keys with the ON UPDATE and/or ON DELETE actions set to CASCADE http://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html Link to comment https://forums.phpfreaks.com/topic/293028-how-to-link-a-column-in-one-table-to-another-table/#findComment-1499279 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.