KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /home/queenjbs/phpMyAdmin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/queenjbs/phpMyAdmin/pmd_relation_upd.php
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 *
 * @version $Id: pmd_relation_upd.php 11979 2008-11-24 10:10:36Z nijel $
 * @package phpMyAdmin-Designer
 */

/**
 *
 */
include_once 'pmd_common.php';
require_once './libraries/relation.lib.php';
extract($_POST, EXTR_SKIP);
extract($_GET, EXTR_SKIP);
$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 (PMA_foreignkey_supported($type_T1) && PMA_foreignkey_supported($type_T2) && $type_T1 == $type_T2) {
    // InnoDB
    $existrel_foreign = PMA_getForeigners($DB2, $T2, '', 'foreign');

    if (isset($existrel_foreign[$F2]['constraint'])) {
        $upd_query  = 'ALTER TABLE ' . PMA_backquote($T2)
                  . ' DROP FOREIGN KEY '
                  . PMA_backquote($existrel_foreign[$F2]['constraint']);
        $upd_rs     = PMA_DBI_query($upd_query);
    }
} else {
    // internal relations
    PMA_query_as_cu('DELETE FROM '
              . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.'
              . $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_upd(1, 'strRelationDeleted');

function PMD_return_upd($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>');
}
?>

Anon7 - 2021