当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_checkChildForeignReferences函数代码示例

本文整理汇总了PHP中PMA_checkChildForeignReferences函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_checkChildForeignReferences函数的具体用法?PHP PMA_checkChildForeignReferences怎么用?PHP PMA_checkChildForeignReferences使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_checkChildForeignReferences函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mb_strpos

    }
    // some types, for example longtext, are reported as
    // "longtext character set latin7" when their charset and / or collation
    // differs from the ones of the corresponding database.
    $tmp = mb_strpos($type, 'character set');
    if ($tmp) {
        $type = mb_substr($type, 0, $tmp - 1);
    }
    // rtrim the type, for cases like "float unsigned"
    $type = rtrim($type);
    if (isset($submit_length) && $submit_length != false) {
        $length = $submit_length;
    }
    // Variable tell if current column is bound in a foreign key constraint or not.
    if (isset($columnMeta['Field']) && isset($_form_params['table'])) {
        $columnMeta['column_status'] = PMA_checkChildForeignReferences($_form_params['db'], $_form_params['table'], $columnMeta['Field'], $foreigners, $child_references);
    }
    // old column attributes
    if ($is_backup) {
        $_form_params = PMA_getFormParamsForOldColumn($columnMeta, $length, $_form_params, $columnNumber, $type, $extracted_columnspec);
    }
    $content_cells[$columnNumber] = PMA_getHtmlForColumnAttributes($columnNumber, isset($columnMeta) ? $columnMeta : array(), mb_strtoupper($type), $length_values_input_size, $length, isset($default_current_timestamp) ? $default_current_timestamp : null, isset($extracted_columnspec) ? $extracted_columnspec : null, isset($submit_attribute) ? $submit_attribute : null, isset($analyzed_sql) ? $analyzed_sql : null, isset($submit_default_current_timestamp) ? $submit_default_current_timestamp : null, $comments_map, isset($fields_meta) ? $fields_meta : null, $is_backup, isset($move_columns) ? $move_columns : array(), $cfgRelation, isset($available_mime) ? $available_mime : array(), isset($mime_map) ? $mime_map : array());
}
// end for
$html = PMA_getHtmlForTableCreateOrAddField($action, $_form_params, $content_cells, $header_cells);
unset($_form_params);
$response = PMA_Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('jquery/jquery.uitablefilter.js');
$scripts->addFile('indexes.js');
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:31,代码来源:tbl_columns_definition_form.inc.php

示例2: PMA_makeConsistentWithList

/**
 * make the columns of given tables consistent with central list of columns.
 * Updates only those columns which are not being referenced.
 *
 * @param string $db              current database
 * @param array  $selected_tables list of selected tables.
 *
 * @return true|PMA\libraries\Message
 */
function PMA_makeConsistentWithList($db, $selected_tables)
{
    $message = true;
    foreach ($selected_tables as $table) {
        $query = 'ALTER TABLE ' . Util::backquote($table);
        $has_list = PMA_getCentralColumnsFromTable($db, $table, true);
        $GLOBALS['dbi']->selectDb($db, $GLOBALS['userlink']);
        foreach ($has_list as $column) {
            $column_status = PMA_checkChildForeignReferences($db, $table, $column['col_name']);
            //column definition can only be changed if
            //it is not referenced by another column
            if ($column_status['isEditable']) {
                $query .= ' MODIFY ' . Util::backquote($column['col_name']) . ' ' . Util::sqlAddSlashes($column['col_type']);
                if ($column['col_length']) {
                    $query .= '(' . $column['col_length'] . ')';
                }
                $query .= ' ' . $column['col_attribute'];
                if ($column['col_isNull']) {
                    $query .= ' NULL';
                } else {
                    $query .= ' NOT NULL';
                }
                $query .= ' ' . $column['col_extra'];
                if ($column['col_default']) {
                    if ($column['col_default'] != 'CURRENT_TIMESTAMP') {
                        $query .= ' DEFAULT \'' . Util::sqlAddSlashes($column['col_default']) . '\'';
                    } else {
                        $query .= ' DEFAULT ' . Util::sqlAddSlashes($column['col_default']);
                    }
                }
                $query .= ',';
            }
        }
        $query = trim($query, " ,") . ";";
        if (!$GLOBALS['dbi']->tryQuery($query, $GLOBALS['userlink'])) {
            if ($message === true) {
                $message = Message::error($GLOBALS['dbi']->getError($GLOBALS['userlink']));
            } else {
                $message->addMessage('<br />');
                $message->addMessage($GLOBALS['dbi']->getError($GLOBALS['userlink']));
            }
        }
    }
    return $message;
}
开发者ID:itgsod-philip-skalander,项目名称:phpmyadmin,代码行数:54,代码来源:central_columns.lib.php


注:本文中的PMA_checkChildForeignReferences函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。