[ Index ] |
|
Code source de phpMyAdmin 2.10.3 |
1 <?php 2 /* $Id: pmd_relation_upd.php 10481 2007-07-11 12:21:48Z lem9 $ */ 3 // vim: expandtab sw=4 ts=4 sts=4: 4 5 include_once 'pmd_common.php'; 6 require_once './libraries/relation.lib.php'; 7 extract($_POST); 8 extract($_GET); 9 $die_save_pos = 0; 10 include_once 'pmd_save_pos.php'; 11 list($DB1,$T1) = explode(".",$T1); 12 list($DB2,$T2) = explode(".",$T2); 13 14 $tables = PMA_DBI_get_tables_full($db, $T1); 15 $type_T1 = strtoupper($tables[$T1]['ENGINE']); 16 $tables = PMA_DBI_get_tables_full($db, $T2); 17 $type_T2 = strtoupper($tables[$T2]['ENGINE']); 18 19 if ($type_T1 == 'INNODB' && $type_T2 == 'INNODB') { 20 // InnoDB 21 $existrel_innodb = PMA_getForeigners($DB2, $T2, '', 'innodb'); 22 23 if (PMA_MYSQL_INT_VERSION >= 40013 && isset($existrel_innodb[$F2]['constraint'])) { 24 $upd_query = 'ALTER TABLE ' . PMA_backquote($T2) 25 . ' DROP FOREIGN KEY ' 26 . PMA_backquote($existrel_innodb[$F2]['constraint']); 27 $upd_rs = PMA_DBI_query($upd_query); 28 } 29 } else { 30 PMA_query_as_cu('DELETE FROM '.$cfg['Server']['relation'].' WHERE ' 31 . 'master_db = \'' . PMA_sqlAddslashes($DB2) . '\'' 32 . 'AND master_table = \'' . PMA_sqlAddslashes($T2) . '\'' 33 . 'AND master_field = \'' . PMA_sqlAddslashes($F2) . '\'' 34 . 'AND foreign_db = \'' . PMA_sqlAddslashes($DB1) . '\'' 35 . 'AND foreign_table = \'' . PMA_sqlAddslashes($T1) . '\'' 36 . 'AND foreign_field = \'' . PMA_sqlAddslashes($F1) . '\'' 37 , FALSE, PMA_DBI_QUERY_STORE); 38 } 39 PMD_return(1, 'strRelationDeleted'); 40 41 function PMD_return($b,$ret) 42 { 43 global $K; 44 header("Content-Type: text/xml; charset=utf-8"); 45 header("Cache-Control: no-cache"); 46 die('<root act="relation_upd" return="'.$ret.'" b="'.$b.'" K="'.$K.'"></root>'); 47 } 48 ?> 49
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 15:18:20 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |