There is a mysql database and a PDO driver. I need to pull out the entire structure, including the foreign keys. How can I pull out all foreign keys without accessing information_schema
?
For example, I have information about the index:
object(stdClass)#14 (13) { ["Table"]=> string(4) "table_name" ["Non_unique"]=> string(1) "1" ["Key_name"]=> string(9) "action_id" ["Seq_in_index"]=> string(1) "1" ["Column_name"]=> string(9) "action_id" ["Collation"]=> string(1) "A" ["Cardinality"]=> string(1) "8" ["Sub_part"]=> NULL ["Packed"]=> NULL ["Null"]=> string(0) "" ["Index_type"]=> string(5) "BTREE" ["Comment"]=> string(0) "" ["Index_comment"]=> string(0) "" }
How to find out which table and which column it refers to?