More concise descriptions for MySQL column types
[phpmyadmin.git] / pmd_display_field.php
blobdcf195f17c096ed7b7c8de54be7d38700f3c246a
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @package PhpMyAdmin-Designer
5 */
7 /**
9 */
10 require_once './libraries/common.inc.php';
12 require_once 'libraries/pmd_common.php';
15 $table = $T;
16 $display_field = $F;
18 if ($cfgRelation['displaywork']) {
20 $disp = PMA_getDisplayField($db, $table);
21 if ($disp) {
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) . '\'';
27 } else {
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) '
35 . ' VALUES('
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);
44 } // end if
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>");