2 /* vim: set expandtab sw=4 ts=4 sts=4: */
5 * @package phpMyAdmin-Designer
11 include_once 'pmd_common.php';
12 require_once './libraries/relation.lib.php';
18 if ($cfgRelation['displaywork']) {
20 $disp = PMA_getDisplayField($db, $table);
22 if ($display_field != $disp) {
23 $upd_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_info'])
24 . ' SET display_field = \'' . PMA_sqlAddslashes($display_field) . '\''
25 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
26 . ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\'';
28 $upd_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_info'])
29 . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
30 . ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\'';
32 } elseif ($display_field != '') {
33 $upd_query = 'INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_info'])
34 . '(db_name, table_name, display_field) '
36 . '\'' . PMA_sqlAddslashes($db) . '\','
37 . '\'' . PMA_sqlAddslashes($table) . '\','
38 . '\'' . PMA_sqlAddslashes($display_field) . '\')';
41 if (isset($upd_query)) {
42 $upd_rs = PMA_query_as_controluser($upd_query);
46 header("Content-Type: text/xml; charset=utf-8");
47 header("Cache-Control: no-cache");
48 die("<root act='save_pos' return=__('Modifications have been saved')></root>");