When I insert a record with a foreign key relationship, how can I change the drop-down to show another foreign table column? By default, it shows the foreign table's primary key (an int) that isn't very descriptive. Can I force it to display another field (like a varchar field with description) from the same foreign table?

For example, if there are foreign table GenderID's of 1=Male and 2=Female, and the foreign key is Person.GenderID, how can I force the dropdown to read "Male" or "Female" instead of "1" or "2"?

example tables:

GenderID  GenderDescription
1         Male
2         Female

PersonID  GenderID
1         2
2         2
3         1

MySQL v5.1.41 tables InnoDB

  • 1
    Similar to: serverfault.com/questions/180847/… (I haven't seen any indication that phpMyAdmin will support this behavior, but I'd be happy to be wrong) – danlefree Oct 18 '10 at 21:42
  • Thanks for the reference. I found, in PMA documentation, the ability to produce a tooltip when browsing data, but you understood that wasn't what I was looking for. – David Fox Oct 18 '10 at 22:17

In the referenced table (Gender) you can go to "Relation view" and under the table there is a select box "Choose field to display", in which you choose column that will be displayed next to GenderId value in the referencing table (Person). phpymadminWiki

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.