In the past few years, I have read many articles on foreign keys in MySQL, but nothing recent. I know that they are good for use on something like a forum topic that has a child post, if I delete a topic with a message 100 related to this topic, foreign keys will make it delete those 100 topics for me, Iām still right then?
I am working on a social network in php / mysql, there is a user table with a user ID, then there are about 10 other tables that are associated with this table with this user ID field, should I use foreign keys on this? I will not need to update all tables, but, for example, if a user deletes this account, in the past I would run PHP as 10 delete requests, 1 for each table for the user. Is it good to use foreign keys?
source
share