I have a table named as contacts and an other table as custom_field_values and many more tables where contact_id is passed as FK.
I want to know those tables who have contact_id as FK.
Asked
Active
Viewed 62 times
0

raja
- 11
- 3
-
if foreign key(contact_id) is with the same name in other table, simply take the natural join of tables, submit the query. If you get some data back , these are those tables. Not 100% true but will work most of the time – Muhammad Usman Oct 07 '16 at 13:14
-
3May have been solved for you here. http://stackoverflow.com/questions/806989/mysql-how-to-i-find-all-tables-that-have-foreign-keys-that-reference-particular#1133461 – Blinkydamo Oct 07 '16 at 13:15
-
@MuhamamdUsman in contacts table it's "id" & and in custom_field_values it's "contacts_id" – raja Oct 07 '16 at 13:19