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 ' . PMA_Util
::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util
::backquote($cfgRelation['table_info'])
25 . ' SET display_field = \'' . PMA_Util
::sqlAddSlashes($display_field) . '\''
26 . ' WHERE db_name = \'' . PMA_Util
::sqlAddSlashes($db) . '\''
27 . ' AND table_name = \'' . PMA_Util
::sqlAddSlashes($table) . '\'';
29 $upd_query = 'DELETE FROM ' . PMA_Util
::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util
::backquote($cfgRelation['table_info'])
30 . ' WHERE db_name = \'' . PMA_Util
::sqlAddSlashes($db) . '\''
31 . ' AND table_name = \'' . PMA_Util
::sqlAddSlashes($table) . '\'';
33 } elseif ($display_field != '') {
34 $upd_query = 'INSERT INTO ' . PMA_Util
::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util
::backquote($cfgRelation['table_info'])
35 . '(db_name, table_name, display_field) '
37 . '\'' . PMA_Util
::sqlAddSlashes($db) . '\','
38 . '\'' . PMA_Util
::sqlAddSlashes($table) . '\','
39 . '\'' . PMA_Util
::sqlAddSlashes($display_field) . '\')';
42 if (isset($upd_query)) {
43 $upd_rs = PMA_queryAsControlUser($upd_query);
47 header("Content-Type: text/xml; charset=utf-8");
48 header("Cache-Control: no-cache");
49 die("<root act='save_pos' return='" . __('Modifications have been saved') . "'></root>");