Whenever I try to insert a new record in my MySQL database using phpMyAdmin, if the column refers to a foreign key, i get a dropdown box with the valid IDs that i can use. The problem is when the database gets too big, the ID is meaningless for me. For example if the ID is the social security number of the employee, i don't know it, but i can probably remember the name. Is there a way to display the row contents next to the ID or at least one column that could be more meaningful to the user? I have seen that feature in phpPgAdmin.
I tried this in the config file:
$cfg['ForeignKeyDropdownOrder'] = array( 'content-id', 'id-content' );
But it didn't work.
To see FKs of a table first select table from the object explorer, then go to Structure tab and then select Relation view. Please note that in different versions it might be in different locations. On the Relation view screen you will see all foreign keys defined for this table (as a foreign table).
When you open the phpMyAdmin home page, click on Databases and then select a database to manage by clicking its name. In the page that opens you will see a list with the database tables, the allowed actions with them, the number of the records, the storage engine, the collation, the tables' sizes, and the overhead.
To see foreign key relationships of a table: SELECT TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM INFORMATION_SCHEMA. KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = 'db_name' AND REFERENCED_TABLE_NAME = 'table_name';
phpMyAdmin has a function for this, but you must be using the InnoDB table type. You must also have pmadb configured.
The column value will now be shown next to the id. It will also be shown when hovering over the foreign key value after making a selection.
For anyone having trouble getting this setup, please see the #relation-view documentation which tells you exactly how to configure it with screenshots.
In addition to what @EternalHour says you also need to check the radio button under view options
that says "Relational display column" if you want the value to be displayed.
If not checked you will only see the Foreign Key value when you hover that specific id.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With