00001 <?php
00002
00003
00004
00005
00012
00013
00014 $foreign_link = false;
00015 if ($foreigners && isset($foreigners[$field])) {
00016 $foreigner = $foreigners[$field];
00017 $foreign_db = $foreigner['foreign_db'];
00018 $foreign_table = $foreigner['foreign_table'];
00019 $foreign_field = $foreigner['foreign_field'];
00020
00021
00022
00023
00024
00025
00026
00027
00028 $the_total = PMA_countRecords($foreign_db, $foreign_table, TRUE);
00029
00030 if ((isset($override_total) && $override_total == true) || $the_total < $cfg['ForeignKeyMaxLimit']) {
00031
00032
00033 $foreign_display = PMA_getDisplayField($foreign_db, $foreign_table);
00034 $dispsql = 'SELECT ' . PMA_backquote($foreign_field)
00035 . (($foreign_display == FALSE) ? '' : ', ' . PMA_backquote($foreign_display))
00036 . ' FROM ' . PMA_backquote($foreign_db) . '.' . PMA_backquote($foreign_table)
00037 . (($foreign_display == FALSE) ? '' :' ORDER BY ' . PMA_backquote($foreign_table) . '.' . PMA_backquote($foreign_display))
00038 . (isset($foreign_limit) ? $foreign_limit : '');
00039 $disp = PMA_DBI_query($dispsql);
00040 if ($disp) {
00041
00042
00043
00044
00045 $disp_row = array();
00046 while ($single_disp_row = @PMA_DBI_fetch_assoc($disp)) {
00047 $disp_row[] = $single_disp_row;
00048 }
00049 @PMA_DBI_free_result($disp);
00050 }
00051 }
00052 else {
00053 unset($disp_row);
00054 $foreign_link = true;
00055 }
00056 }
00057
00058 ?>