I’m creating a class in PHP where I just have the parameter of the Table Name and fetch all the Columns and Values. But I don’t know how get the values of the Columns with Foreign Keys.
That’s because I don’t know to which table is related.
I need a way that I can get the Foreign Key with PHP or SQL from a known table?
In MySql, you can query the
information_schemato get meta information about the database.From: https://github.com/troelskn/pdoext/blob/master/lib/pdoext/connection.inc.php#L413 (Specifically the
loadKeysfunction)