diff --git a/tbl_relation.php3 b/tbl_relation.php3 index 2d27b8939..17652046a 100644 --- a/tbl_relation.php3 +++ b/tbl_relation.php3 @@ -52,7 +52,22 @@ if (!empty($cfg['Server']['relation']) } // end if... else.... } // end while } // end if - +if (!empty($cfg['Server']['table_info']) + && isset($submit_show) && $submit_show == 'true') { + $test_query = 'SELECT display_field from ' . PMA_backquote($cfg['Server']['table_info']) + . ' WHERE table_name = \'' . PMA_sqlAddslashes($table) . '\' '; + $test_rs = mysql_query($test_query) or PMA_mysqlDie('', $test_query, '', $err_url_0); + if(mysql_num_rows($test_rs) > 0){ + $upd_query = 'UPDATE ' . PMA_backquote($cfg['Server']['table_info']) . ' SET' + . ' display_field = \'' . PMA_sqlAddslashes($display_field) .'\' ' + . ' WHERE table_name = \'' . PMA_sqlAddslashes($table) . '\' '; + $upd_rs = mysql_query($upd_query) or PMA_mysqlDie('', $upd_query, '', $err_url_0); + }else{ + $ins_query = 'insert into ' . PMA_backquote($cfg['Server']['table_info']) . ' (table_name,display_field)' + . ' values(\'' . PMA_sqlAddslashes($table) . '\',\'' . PMA_sqlAddslashes($display_field) .'\') '; + $ins_rs = mysql_query($ins_query) or PMA_mysqlDie('', $ins_query, '', $err_url_0); + } +} /** * Dialog @@ -157,6 +172,36 @@ if ($col_rs && mysql_num_rows($col_rs) > 0) { + + +
+ + + +

+ +