source: www/mysql/pmd_display_field.php@ 1

Last change on this file since 1 was 1, checked in by george, 17 years ago

Prvotní import všeho

File size: 1.8 KB
Line 
1<?php
2/* $Id: pmd_display_field.php 9828 2007-01-05 17:30:36Z lem9 $ */
3// vim: expandtab sw=4 ts=4 sts=4:
4
5/*
6@author Ivan A Kirillov (Ivan.A.Kirillov@gmail.com)
7*/
8
9include_once 'pmd_common.php';
10require_once './libraries/relation.lib.php';
11
12
13$table = $T;
14$display_field = $F;
15
16if ($cfgRelation['displaywork']) {
17
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) . '\'';
29 }
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) . '\')';
37 }
38
39 if (isset($upd_query)) {
40 $upd_rs = PMA_query_as_cu($upd_query);
41 }
42} // end if
43
44header("Content-Type: text/xml; charset=utf-8");
45header("Cache-Control: no-cache");
46die("<root act='save_pos' return='strModifications'></root>");
47?>
Note: See TracBrowser for help on using the repository browser.