Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

Gender
GenderID  GenderDescription
1         Male
2         Female

Person
PersonID  GenderID
1         2
2         2
3         1

MySQL v5.1.41 tables InnoDB

share|improve this question
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. –  gr33d Oct 18 '10 at 22:17
add comment

1 Answer

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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