2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * @package PhpMyAdmin-Designer
10 require_once './libraries/common.inc.php';
12 PMA_Response
::getInstance()->disable();
14 require_once 'libraries/pmd_common.php';
17 $display_field = $_POST['F'];
19 if ($cfgRelation['displaywork']) {
21 $disp = PMA_getDisplayField($db, $table);
23 if ($display_field != $disp) {
24 $upd_query = 'UPDATE '
25 . PMA_Util
::backquote($GLOBALS['cfgRelation']['db'])
27 . PMA_Util
::backquote($cfgRelation['table_info'])
28 . ' SET display_field = \''
29 . PMA_Util
::sqlAddSlashes($display_field) . '\''
30 . ' WHERE db_name = \'' . PMA_Util
::sqlAddSlashes($db) . '\''
31 . ' AND table_name = \'' . PMA_Util
::sqlAddSlashes($table) . '\'';
33 $upd_query = 'DELETE FROM '
34 . PMA_Util
::backquote($GLOBALS['cfgRelation']['db'])
36 . PMA_Util
::backquote($cfgRelation['table_info'])
37 . ' WHERE db_name = \'' . PMA_Util
::sqlAddSlashes($db) . '\''
38 . ' AND table_name = \'' . PMA_Util
::sqlAddSlashes($table) . '\'';
40 } elseif ($display_field != '') {
41 $upd_query = 'INSERT INTO '
42 . PMA_Util
::backquote($GLOBALS['cfgRelation']['db'])
44 . PMA_Util
::backquote($cfgRelation['table_info'])
45 . '(db_name, table_name, display_field) '
47 . '\'' . PMA_Util
::sqlAddSlashes($db) . '\','
48 . '\'' . PMA_Util
::sqlAddSlashes($table) . '\','
49 . '\'' . PMA_Util
::sqlAddSlashes($display_field) . '\')';
52 if (isset($upd_query)) {
53 $upd_rs = PMA_queryAsControlUser($upd_query);
57 header("Content-Type: text/xml; charset=utf-8");
58 header("Cache-Control: no-cache");
59 die("<root act='save_pos' return='"
60 . __('Modifications have been saved') . "'></root>");