Hi!
For example, i have some field marked as mysql_field_name($r, $i). I called mysql_field_flags() and I found out that this is "Multiple_Key'. So, this is a FOREIGN KEY to some table. How can I find out that table name?
MySQL get referenced table name
Moderator: General Moderators
Re: MySQL get referenced table name
I don't think you can. That information isn't stored anywhere in MySQL.Leshij wrote:Hi!
For example, i have some field marked as mysql_field_name($r, $i). I called mysql_field_flags() and I found out that this is "Multiple_Key'. So, this is a FOREIGN KEY to some table. How can I find out that table name?
Re: MySQL get referenced table name
But, somehow, MySQL recognizes, that this field references to some table, that means, that this info IS stored somewhere.
Re: MySQL get referenced table name
No, you supply that information in your query. Try doing a JOIN or a WHERE without explicitly providing the key relationships.Leshij wrote:But, somehow, MySQL recognizes, that this field references to some table, that means, that this info IS stored somewhere.