0) { $upd_query = 'UPDATE ' . PMA_backquote($cfg['Server']['table_info']) . ' SET' . ' display_field = \'' . PMA_sqlAddslashes($display_field) . '\'' . ' WHERE table_name = \'' . PMA_sqlAddslashes($table) . '\''; $upd_rs = mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0); } else { $ins_query = 'INSERT INTO ' . PMA_backquote($cfg['Server']['table_info']) . ' (table_name, display_field)' . ' VALUES(\'' . PMA_sqlAddslashes($table) . '\', \'' . PMA_sqlAddslashes($display_field) .'\')'; $ins_rs = mysql_query($ins_query) or PMA_mysqlDie('', $ins_query, '', $err_url_0); } } // end if /** * Dialog */ if ($cfg['Server']['relation']) { $rel_work = FALSE; // Mike Beck: get all Table-Fields to choose relation $tab_query = 'SHOW TABLES FROM ' . PMA_backquote($db); $tab_rs = mysql_query($tab_query) or PMA_mysqlDie('', $tab_query, '', $err_url_0); $selectboxall['nix'] = '--'; while ($curr_table = @mysql_fetch_array($tab_rs)) { if (($curr_table[0] != $table) && ($curr_table[0] != $cfg['Server']['relation'])) { $fi_query = 'SHOW KEYS FROM ' . PMA_backquote($curr_table[0]); $fi_rs = mysql_query($fi_query) or PMA_mysqlDie('', $fi_query, '', $err_url_0); if ($fi_rs && mysql_num_rows($fi_rs) > 0) { while ($curr_field = mysql_fetch_array($fi_rs)) { if (isset($curr_field['Key_name']) && $curr_field['Key_name'] == 'PRIMARY') { $field_full = $curr_field['Table'] . '.' . $curr_field['Column_name']; $field_v = $curr_field['Table'] . '->' . $curr_field['Column_name']; break; } else if (isset($curr_field['non_unique']) && $curr_field['non_unique'] == 0) { // if we can't find a primary key we take any unique one $field_full = $curr_field['Table'] . '.' . $curr_field['Column_name']; $field_v = $curr_field['Table'] . '->' . $curr_field['Column_name']; } // end if } // end while if (isset($field_full) && isset($field_v)) { $selectboxall[$field_full] = $field_v; } } // end if (mysql_num_rows) } if ($curr_table[0] == $cfg['Server']['relation']) { $rel_work = TRUE; } } // end while // create Array of Relations (Mike Beck) if ($rel_work) { $rel_query = 'SELECT master_field, concat(foreign_table, \'.\', foreign_field) AS rel' . ' FROM ' . PMA_backquote($cfg['Server']['relation']) . ' WHERE master_table = \'' . PMA_sqlAddslashes($table) . '\''; $relations = @mysql_query($rel_query) or PMA_mysqlDie('', $rel_query, '', $err_url); while ($relrow = @mysql_fetch_array($relations)) { $rel_col = $relrow['master_field']; $rel_dest[$rel_col] = $relrow['rel']; } // end while } // end if } // end if // now find out the columns of our $table $col_query = 'SHOW COLUMNS FROM ' . PMA_backquote($table); $col_rs = mysql_query($col_query) or PMA_mysqlDie('', $col_query, '', $err_url_0); if ($col_rs && mysql_num_rows($col_rs) > 0) { ?>
 
0) { echo "\n"; ?>