PHPMyAdmin display description in foreign key drop down selection

It is possible in PHPMyAdmin to display the description of a foreign key, instead of the identifier field.


PHPMyAdmin drop down foreign key description

It is possible in PHPMyAdmin to display the description of a foreign key, instead of the identifier field.

For example, with a table of cities referencing a table of countries, where the identifier is a unique incremental number, display the country description instead of the number.

SQL table insert in PHPMyAdmin

Starting with a table in which we try to insert data.

If the foreign keys have not been set, or even by default, then we have to enter directly the identifier referencing the other table, which we want to avoid, as we do not know which identifier corresponds to which entry.

Table structure relation view

To display the description instead of the identifier, we have to open the table that is referenced, go the menu structure, and then click on the Relation View button.

Foreign key column to display

Here, we can see the relations that this table have with other tables.

At the bottom, there is a small part where we can choose the column to display.

By default, the field referenced is displayed in other tables referencing that table.

Changing this value, for example to select the description field of the table, will allow other tables to display it instead of the default identifier.

PHPMyAdmin drop down display foreign key

Master Website Creation: Enroll Now!

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!

Enroll Here

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!

After having performed this change, we now see a drop down with the foreign keys description and identifier, instead of only seeing the identifier.

The drop down will however only be displayed for a small amount of foreign keys.

Browse foreign values

If there are too much of them, it will be replaced by a link, named browse foreign values.

Clicking on that link will open a pop-up with a search form, to allow searching in thousands of foreign keys descriptions and identifiers.

Simply type there a few characters of the description that you are looking for, and press Go, to see all results matching the search.

Pay attention, the search is case sensitive.

Problem description

PHPMyAdmin display description in foreign key drop down selection, phpMyAdmin foreign key drop-down field values, How do I display content for foreign keys in phpMyAdmin, phpMyAdmin foreign key drop-down field values, how to set foreign key in phpMyAdmin xampp, phpMyAdmin foreign key constraint name, how to drop column with foreign key in phpMyAdmin, how to map foreign key in phpMyAdmin, phpMyAdmin link foreign key.

Frequently Asked Questions

How can PHPMyAdmin be configured to show descriptive names in foreign key drop-down selections instead of just IDs?
To display descriptive names in foreign key drop-downs, you need to utilize the Relation view in PHPMyAdmin to set up foreign key constraints that reference the descriptive column. Additionally, using the Designer view can help visually configure these relationships for easier management.

Yoann Bierling
About the author - Yoann Bierling
Yoann Bierling is a Web Publishing & Digital Consulting professional, making a global impact through expertise and innovation in technologies. Passionate about empowering individuals and organizations to thrive in the digital age, he is driven to deliver exceptional results and drive growth through educational content creation.

Master Website Creation: Enroll Now!

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!

Enroll Here

Transform your digital presence with our comprehensive Website Creation course – start your journey to becoming a web expert today!



Comments (0)

Leave a comment