Database Reference
In-Depth Information
The drop-down list of foreign keys
Going back to the book table, in Insert mode (or in Edit mode), we now see a
drop-down list of the possible keys for each field that has a defined relation. The
list contains the keys and the description (display field) in both orders—key to the
display field as well as display field to the key. This enables us to use the keyboard,
and type the first letter of either the key or the display field.
Only the key (in this case 1 ) will be stored in the book table. The display
field is there only to assist us.
By default, this drop-down list will appear if there are a maximum of 100 rows in the
foreign table. This is controlled by the following parameter:
$cfg['ForeignKeyMaxLimit'] = 100;
For foreign tables bigger than that, a distinct window appears—the foreign-table
window (see the next section) that can be browsed.
We might prefer to see information differently in the drop-down list. Here, John
Smith is the content and 1 is the ID. The default display is controlled by
$cfg['ForeignKeyDropdownOrder'] = array( 'content-id', 'id-content');
We can use one or both of the strings— content-id and id-content —in the defining
array and in the order we prefer. Thus, defining $cfg['ForeignKeyDropdownOrder']
to array('id-content') would produce a list with only those choices:
1 - John Smith
2 - Maria Sunshine
3 - André Smith
 
Search WWH ::




Custom Search