| Server IP : 61.19.30.66 / Your IP : 216.73.216.59 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /var/www/phpmyadming/ |
Upload File : |
<?php
/* $Id: pmd_relation_upd.php 10481 2007-07-11 12:21:48Z lem9 $ */
// vim: expandtab sw=4 ts=4 sts=4:
include_once 'pmd_common.php';
require_once './libraries/relation.lib.php';
extract($_POST);
extract($_GET);
$die_save_pos = 0;
include_once 'pmd_save_pos.php';
list($DB1,$T1) = explode(".",$T1);
list($DB2,$T2) = explode(".",$T2);
$tables = PMA_DBI_get_tables_full($db, $T1);
$type_T1 = strtoupper($tables[$T1]['ENGINE']);
$tables = PMA_DBI_get_tables_full($db, $T2);
$type_T2 = strtoupper($tables[$T2]['ENGINE']);
if ($type_T1 == 'INNODB' && $type_T2 == 'INNODB') {
// InnoDB
$existrel_innodb = PMA_getForeigners($DB2, $T2, '', 'innodb');
if (PMA_MYSQL_INT_VERSION >= 40013 && isset($existrel_innodb[$F2]['constraint'])) {
$upd_query = 'ALTER TABLE ' . PMA_backquote($T2)
. ' DROP FOREIGN KEY '
. PMA_backquote($existrel_innodb[$F2]['constraint']);
$upd_rs = PMA_DBI_query($upd_query);
}
} else {
PMA_query_as_cu('DELETE FROM '.$cfg['Server']['relation'].' WHERE '
. 'master_db = \'' . PMA_sqlAddslashes($DB2) . '\''
. 'AND master_table = \'' . PMA_sqlAddslashes($T2) . '\''
. 'AND master_field = \'' . PMA_sqlAddslashes($F2) . '\''
. 'AND foreign_db = \'' . PMA_sqlAddslashes($DB1) . '\''
. 'AND foreign_table = \'' . PMA_sqlAddslashes($T1) . '\''
. 'AND foreign_field = \'' . PMA_sqlAddslashes($F1) . '\''
, FALSE, PMA_DBI_QUERY_STORE);
}
PMD_return(1, 'strRelationDeleted');
function PMD_return($b,$ret)
{
global $K;
header("Content-Type: text/xml; charset=utf-8");
header("Cache-Control: no-cache");
die('<root act="relation_upd" return="'.$ret.'" b="'.$b.'" K="'.$K.'"></root>');
}
?>