Added FAQ in Documentation.html about 'How to use Zoom search feature?' (FAQ 6.32)
[phpmyadmin/ammaryasirr.git] / pmd_display_field.php
blob9f8291200e7b142c3e3f9873880ea5a7c6bff5e7
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @package phpMyAdmin-Designer
5 */
7 /**
9 */
10 include_once './libraries/pmd_common.php';
13 $table = $T;
14 $display_field = $F;
16 if ($cfgRelation['displaywork']) {
18 $disp = PMA_getDisplayField($db, $table);
19 if ($disp) {
20 if ($display_field != $disp) {
21 $upd_query = 'UPDATE ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_info'])
22 . ' SET display_field = \'' . PMA_sqlAddSlashes($display_field) . '\''
23 . ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
24 . ' AND table_name = \'' . PMA_sqlAddSlashes($table) . '\'';
25 } else {
26 $upd_query = 'DELETE FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_info'])
27 . ' WHERE db_name = \'' . PMA_sqlAddSlashes($db) . '\''
28 . ' AND table_name = \'' . PMA_sqlAddSlashes($table) . '\'';
30 } elseif ($display_field != '') {
31 $upd_query = 'INSERT INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_info'])
32 . '(db_name, table_name, display_field) '
33 . ' VALUES('
34 . '\'' . PMA_sqlAddSlashes($db) . '\','
35 . '\'' . PMA_sqlAddSlashes($table) . '\','
36 . '\'' . PMA_sqlAddSlashes($display_field) . '\')';
39 if (isset($upd_query)) {
40 $upd_rs = PMA_query_as_controluser($upd_query);
42 } // end if
44 header("Content-Type: text/xml; charset=utf-8");
45 header("Cache-Control: no-cache");
46 die("<root act='save_pos' return=__('Modifications have been saved')></root>");