Search code examples
mysqlforeign-keysphpmyadmin

phpmyadmin and foreign keys


I added a foreign key constraint to one of my fields.

On insert, the field is showing up as a drop down instead of a text box, as expected.

But the drop down has each value listed twice, once with a minus sign before the value and once with the minus sign after the value.

Like this:

- value1
- value2
- value3
value1 -
value2 -
value3 -

What does this mean?


Solution

  • Phpmyadmin by default shows foreign key value and a custom description field next to it (which is set in "Relation view" for the table) separated by hyphen.

    See also the phpMyAdmin FAQ 6.21, "In edit/insert mode, how can I see a list of possible values for a column, based on some foreign table?".