Relation view

In order to get it working, you first have to properly create the [[pmadb|pmadb]]. Once that is setup, select a table's "Structure" page. Below the table definition, a link called "Relation view" is shown. If you click that link, a page will be shown that offers you to create a link to another table for any (most) fields. Only PRIMARY KEYS are shown there, so if the field you are referring to is not shown, you most likely are doing something wrong. The drop-down at the bottom is the field which will be used as the name for a record.

Relation view example
_images/pma-relations-relation-view-link.png _images/pma-relations-relation-link.png

Let's say you have categories and links and one category can contain several links. Your table structure would be something like this:

Open the relation view (below the table structure) page for the link table and for category_id field, you select category.category_id as master record.

If you now browse the link table, the category_id field will be a clickable hyperlink to the proper category record. But all you see is just the category_id, not the name of the category._images/pma-relations-relation-name.png

To fix this, open the relation view of the category table and in the drop down at the bottom, select "name". If you now browse the link table again and hover the mouse over the category_id hyperlink, the value from the related category will be shown as tooltip._images/pma-relations-links.png