im trying to obtain a table name of foreign assoc in mysql with PDO. for example, i have:
users table
+------------+----------+------+-----+-----+----------------+
| Field | Type | Null | Key | AI | Foreign Keys |
+------------+----------+------+-----+-----+----------------+
| id | int(255) | NO | PRI | yes | |
| username | char(16) | NO | | | |
| password | char(32) | NO | UNI | | |
| group | int(255) | NO | MUL | | mytable.group |
| created | datetime | NO | | | |
+------------+----------+------+-----+-----+----------------+
group table
+------------+----------+------+-----+-----+----------------+
| Field | Type | Null | Key | AI | Foreign Keys |
+------------+----------+------+-----+-----+----------------+
| id | int(255) | NO | PRI | YES | |
| name | char(16) | NO | UNI | | |
| description| TEXT | YES | | | |
+------------+----------+------+-----+-----+----------------+
I want to obtain the name of foreign table assoc(users.group => group ) dinamically. SHOW COLUMNS and DESCRIBE commands doesnt show a assoc.
If anyone knows how to do it I will be very grateful. Thanks!