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


PHP PMA_Table::getIndexedColumns方法代码示例

本文整理汇总了PHP中PMA_Table::getIndexedColumns方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Table::getIndexedColumns方法的具体用法?PHP PMA_Table::getIndexedColumns怎么用?PHP PMA_Table::getIndexedColumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMA_Table的用法示例。


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

示例1: while

        $tab_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
        // [0] of the row is the name
    }
    $tab_rs = PMA_DBI_query($tab_query, null, PMA_DBI_QUERY_STORE);
    $selectboxall[] = '';
    $selectboxall_foreign[] = '';
    while ($curr_table = PMA_DBI_fetch_row($tab_rs)) {
        $current_table = new PMA_Table($curr_table[0], $db);
        // explicitely ask for non-quoted list of indexed columns
        $selectboxall = array_merge($selectboxall, $current_table->getUniqueColumns($backquoted = false));
        // if foreign keys are supported, collect all keys from other
        // tables of the same engine
        if (PMA_foreignkey_supported($tbl_type) && isset($curr_table[1]) && strtoupper($curr_table[1]) == $tbl_type) {
            // explicitely ask for non-quoted list of indexed columns
            // need to obtain backquoted values to support dots inside values
            $selectboxall_foreign = array_merge($selectboxall_foreign, $current_table->getIndexedColumns($backquoted = true));
        }
    }
    // end while over tables
}
// end if
// Now find out the columns of our $table
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
$col_rs = PMA_DBI_try_query('SHOW COLUMNS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE);
if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
    while ($row = PMA_DBI_fetch_assoc($col_rs)) {
        $save_row[] = $row;
    }
    $saved_row_cnt = count($save_row);
    ?>
    <fieldset>
开发者ID:fathitarek,项目名称:cop5725-dbms-project,代码行数:31,代码来源:tbl_relation.php

示例2: testGetIndexedColumns

 /**
  * Test for getIndexedColumns
  *
  * @return void
  */
 public function testGetIndexedColumns()
 {
     $table = 'PMA_BookMark';
     $db = 'PMA';
     $table = new PMA_Table($table, $db);
     $return = $table->getIndexedColumns();
     $expect = array('`PMA`.`PMA_BookMark`.`column1`', '`PMA`.`PMA_BookMark`.`column3`', '`PMA`.`PMA_BookMark`.`column5`', '`PMA`.`PMA_BookMark`.`ACCESSIBLE`', '`PMA`.`PMA_BookMark`.`ADD`', '`PMA`.`PMA_BookMark`.`ALL`');
     $this->assertEquals($expect, $return);
 }
开发者ID:nervo,项目名称:phpmyadmin,代码行数:14,代码来源:PMA_Table_test.php

示例3: PMA_sendHtmlForColumnDropdownList

/**
 * Function to send html for column dropdown list
 *
 * @return void
 */
function PMA_sendHtmlForColumnDropdownList()
{
    $response = PMA_Response::getInstance();
    $foreignTable = $_REQUEST['foreignTable'];
    $table_obj = new PMA_Table($foreignTable, $_REQUEST['foreignDb']);
    // Since views do not have keys defined on them provide the full list of columns
    if (PMA_Table::isView($_REQUEST['foreignDb'], $foreignTable)) {
        $columnList = $table_obj->getColumns(false, false);
    } else {
        $columnList = $table_obj->getIndexedColumns(false, false);
    }
    $columns = array();
    foreach ($columnList as $column) {
        $columns[] = htmlspecialchars($column);
    }
    $response->addJSON('columns', $columns);
    // @todo should be: $server->db($db)->table($table)->primary()
    $primary = PMA_Index::getPrimary($foreignTable, $_REQUEST['foreignDb']);
    if (false === $primary) {
        return;
    }
    $primarycols = array_keys($primary->getColumns());
    $response->addJSON('primary', $primarycols);
}
开发者ID:1290800466,项目名称:yiyuanduobao,代码行数:29,代码来源:tbl_relation.lib.php

示例4: while

    } else {
        $tab_query = 'SHOW TABLES FROM ' . PMA_backquote($db);
        // [0] of the row is the name
    }
    $tab_rs = PMA_DBI_query($tab_query, null, PMA_DBI_QUERY_STORE);
    $selectboxall[] = '';
    $selectboxall_foreign[] = '';
    while ($curr_table = PMA_DBI_fetch_row($tab_rs)) {
        $current_table = new PMA_Table($curr_table[0], $db);
        // explicitely ask for non-quoted list of indexed columns
        $selectboxall = array_merge($selectboxall, $current_table->getUniqueColumns(false));
        // if foreign keys are supported, collect all keys from other
        // tables of the same engine
        if (PMA_foreignkey_supported($tbl_type) && isset($curr_table[1]) && strtoupper($curr_table[1]) == $tbl_type) {
            // explicitely ask for non-quoted list of indexed columns
            $selectboxall_foreign = array_merge($selectboxall_foreign, $current_table->getIndexedColumns(false));
        }
    }
    // end while over tables
}
// end if
// Now find out the columns of our $table
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
$col_rs = PMA_DBI_try_query('SHOW COLUMNS FROM ' . PMA_backquote($table) . ';', null, PMA_DBI_QUERY_STORE);
if ($col_rs && PMA_DBI_num_rows($col_rs) > 0) {
    while ($row = PMA_DBI_fetch_assoc($col_rs)) {
        $save_row[] = $row;
    }
    $saved_row_cnt = count($save_row);
    ?>
    <fieldset>
开发者ID:lavsurgut,项目名称:autoauc2,代码行数:31,代码来源:tbl_relation.php

示例5: PMA_sendHtmlForColumnDropdownList

/**
 * Function to send html for column dropdown list
 *
 * @return void
 */
function PMA_sendHtmlForColumnDropdownList()
{
    $response = PMA_Response::getInstance();
    $foreignTable = $_REQUEST['foreignTable'];
    $table_obj = new PMA_Table($foreignTable, $_REQUEST['foreignDb']);
    $columns = array();
    foreach ($table_obj->getIndexedColumns(false, false) as $column) {
        $columns[] = htmlspecialchars($column);
    }
    $response->addJSON('columns', $columns);
}
开发者ID:graurus,项目名称:testgit_t37,代码行数:16,代码来源:tbl_relation.lib.php

示例6: array

require_once 'libraries/Template.class.php';
require_once 'libraries/Table.class.php';
require_once 'libraries/structure.lib.php';
$response = PMA_Response::getInstance();
// Send table of column names to populate corresponding dropdowns depending
// on the current selection
if (isset($_REQUEST['getDropdownValues']) && $_REQUEST['getDropdownValues'] === 'true') {
    if (isset($_REQUEST['foreignTable'])) {
        // if both db and table are selected
        $foreignTable = $_REQUEST['foreignTable'];
        $table_obj = new PMA_Table($foreignTable, $_REQUEST['foreignDb']);
        // Since views do not have keys defined on them provide the full list of columns
        if (PMA_Table::isView($_REQUEST['foreignDb'], $foreignTable)) {
            $columnList = $table_obj->getColumns(false, false);
        } else {
            $columnList = $table_obj->getIndexedColumns(false, false);
        }
        $columns = array();
        foreach ($columnList as $column) {
            $columns[] = htmlspecialchars($column);
        }
        $response->addJSON('columns', $columns);
        // @todo should be: $server->db($db)->table($table)->primary()
        $primary = PMA_Index::getPrimary($foreignTable, $_REQUEST['foreignDb']);
        if (false === $primary) {
            return;
        }
        $primarycols = array_keys($primary->getColumns());
        $response->addJSON('primary', $primarycols);
    } else {
        // if only the db is selected
开发者ID:hewenhao2008,项目名称:phpmyadmin,代码行数:31,代码来源:tbl_relation.php

示例7: isset

        $selectboxall = array_merge(
            $selectboxall,
            $current_table->getUniqueColumns($backquoted = false)
        );

        // if foreign keys are supported, collect all keys from other
        // tables of the same engine
        if (PMA_Util::isForeignKeySupported($tbl_storage_engine)
            && isset($curr_table[1])
            && strtoupper($curr_table[1]) == $tbl_storage_engine
        ) {
             // explicitely ask for non-quoted list of indexed columns
             // need to obtain backquoted values to support dots inside values
             $selectboxall_foreign = array_merge(
                 $selectboxall_foreign,
                 $current_table->getIndexedColumns($backquoted = true)
             );
        }
    } // end while over tables
} // end if

// Now find out the columns of our $table
// need to use PMA_DBI_QUERY_STORE with PMA_DBI_num_rows() in mysqli
$columns = PMA_DBI_get_columns($db, $table);

if (count($columns) > 0) {
    foreach ($columns as $row) {
        $save_row[] = $row;
    }
    $saved_row_cnt  = count($save_row);
    ?>
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:31,代码来源:tbl_relation.php


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