PHPMyAdmin display description in foreign key drop down selection

Quick links

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

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.

Smartphone help for Apple and Android devices

Similar articles

Comments (0)

Leave a comment