當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PMA_REL_renameSingleTable函數代碼示例

本文整理匯總了PHP中PMA_REL_renameSingleTable函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_REL_renameSingleTable函數的具體用法?PHP PMA_REL_renameSingleTable怎麽用?PHP PMA_REL_renameSingleTable使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了PMA_REL_renameSingleTable函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: PMA_REL_renameTable

/**
 * Rename a table in relation tables
 *
 * usually called after table has been moved
 *
 * @param string $source_db    Source database name
 * @param string $target_db    Target database name
 * @param string $source_table Source table name
 * @param string $target_table Target table name
 *
 * @return void
 */
function PMA_REL_renameTable($source_db, $target_db, $source_table, $target_table)
{
    // Move old entries from PMA-DBs to new table
    if ($GLOBALS['cfgRelation']['commwork']) {
        PMA_REL_renameSingleTable('column_info', $source_db, $target_db, $source_table, $target_table, 'db_name', 'table_name');
    }
    // updating bookmarks is not possible since only a single table is
    // moved, and not the whole DB.
    if ($GLOBALS['cfgRelation']['displaywork']) {
        PMA_REL_renameSingleTable('table_info', $source_db, $target_db, $source_table, $target_table, 'db_name', 'table_name');
    }
    if ($GLOBALS['cfgRelation']['relwork']) {
        PMA_REL_renameSingleTable('relation', $source_db, $target_db, $source_table, $target_table, 'foreign_db', 'foreign_table');
        PMA_REL_renameSingleTable('relation', $source_db, $target_db, $source_table, $target_table, 'master_db', 'master_table');
    }
    if ($GLOBALS['cfgRelation']['pdfwork']) {
        if ($source_db == $target_db) {
            // rename within the database can be handled
            PMA_REL_renameSingleTable('table_coords', $source_db, $target_db, $source_table, $target_table, 'db_name', 'table_name');
        } else {
            // if the table is moved out of the database we can no loger keep the
            // record for table coordinate
            $remove_query = "DELETE FROM " . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . "." . PMA_Util::backquote($GLOBALS['cfgRelation']['table_coords']) . " WHERE db_name  = '" . PMA_Util::sqlAddSlashes($source_db) . "'" . " AND table_name = '" . PMA_Util::sqlAddSlashes($source_table) . "'";
            PMA_queryAsControlUser($remove_query);
        }
    }
    if ($GLOBALS['cfgRelation']['uiprefswork']) {
        PMA_REL_renameSingleTable('table_uiprefs', $source_db, $target_db, $source_table, $target_table, 'db_name', 'table_name');
    }
    if ($GLOBALS['cfgRelation']['navwork']) {
        // update hidden items inside table
        PMA_REL_renameSingleTable('navigationhiding', $source_db, $target_db, $source_table, $target_table, 'db_name', 'table_name');
        // update data for hidden table
        $query = "UPDATE " . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . "." . PMA_Util::backquote($GLOBALS['cfgRelation']['navigationhiding']) . " SET db_name = '" . PMA_Util::sqlAddSlashes($target_db) . "'," . " item_name = '" . PMA_Util::sqlAddSlashes($target_table) . "'" . " WHERE db_name  = '" . PMA_Util::sqlAddSlashes($source_db) . "'" . " AND item_name = '" . PMA_Util::sqlAddSlashes($source_table) . "'" . " AND item_type = 'table'";
        PMA_queryAsControlUser($query);
    }
}
開發者ID:mercysmart,項目名稱:naikelas,代碼行數:49,代碼來源:relation.lib.php

示例2: PMA_REL_renameTable

/**
 * Rename a table in relation tables
 *
 * usually called after table has been moved
 *
 * @param string $source_db    Source database name
 * @param string $target_db    Target database name
 * @param string $source_table Source table name
 * @param string $target_table Target table name
 *
 * @return void
 */
function PMA_REL_renameTable($source_db, $target_db, $source_table, $target_table)
{
    // Move old entries from PMA-DBs to new table
    if ($GLOBALS['cfgRelation']['commwork']) {
        PMA_REL_renameSingleTable('column_info', $source_db, $target_db, $source_table, $target_table, 'db_name', 'table_name');
    }
    // updating bookmarks is not possible since only a single table is
    // moved, and not the whole DB.
    if ($GLOBALS['cfgRelation']['displaywork']) {
        PMA_REL_renameSingleTable('table_info', $source_db, $target_db, $source_table, $target_table, 'db_name', 'table_name');
    }
    if ($GLOBALS['cfgRelation']['relwork']) {
        PMA_REL_renameSingleTable('relation', $source_db, $target_db, $source_table, $target_table, 'foreign_db', 'foreign_table');
        PMA_REL_renameSingleTable('relation', $source_db, $target_db, $source_table, $target_table, 'master_db', 'master_table');
    }
    /**
     * @todo Can't get moving PDFs the right way. The page numbers
     * always get screwed up independently from duplication because the
     * numbers do not seem to be stored on a per-database basis. Would
     * the author of pdf support please have a look at it?
     */
    if ($GLOBALS['cfgRelation']['pdfwork']) {
        PMA_REL_renameSingleTable('table_coords', $source_db, $target_db, $source_table, $target_table, 'db_name', 'table_name');
    }
    if ($GLOBALS['cfgRelation']['designerwork']) {
        PMA_REL_renameSingleTable('designer_coords', $source_db, $target_db, $source_table, $target_table, 'db_name', 'table_name');
    }
}
開發者ID:yszar,項目名稱:linuxwp,代碼行數:40,代碼來源:relation.lib.php


注:本文中的PMA_REL_renameSingleTable函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。