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


PHP Table::getName方法代碼示例

本文整理匯總了PHP中PMA\libraries\Table::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Table::getName方法的具體用法?PHP Table::getName怎麽用?PHP Table::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PMA\libraries\Table的用法示例。


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

示例1: testGetName

 /**
  * Test getName & getDbName
  *
  * @return void
  */
 public function testGetName()
 {
     $table = new Table('table1', 'pma_test');
     $this->assertEquals("table1", $table->getName());
     $this->assertEquals("`table1`", $table->getName(true));
     $this->assertEquals("pma_test", $table->getDbName());
     $this->assertEquals("`pma_test`", $table->getDbName(true));
 }
開發者ID:pboutin44,項目名稱:maintest,代碼行數:13,代碼來源:TableTest.php

示例2: unset

/**
 * If the table has to be maintained
 */
if (isset($_REQUEST['table_maintenance'])) {
    include_once 'sql.php';
    unset($result);
}
/**
 * Updates table comment, type and options if required
 */
if (isset($_REQUEST['submitoptions'])) {
    $_message = '';
    $warning_messages = array();
    if (isset($_REQUEST['new_name'])) {
        // Get original names before rename operation
        $oldTable = $pma_table->getName();
        $oldDb = $pma_table->getDbName();
        if ($pma_table->rename($_REQUEST['new_name'])) {
            if (isset($_REQUEST['adjust_privileges']) && !empty($_REQUEST['adjust_privileges'])) {
                PMA_AdjustPrivileges_renameOrMoveTable($oldDb, $oldTable, $_REQUEST['db'], $_REQUEST['new_name']);
            }
            // Reselect the original DB
            $GLOBALS['db'] = $oldDb;
            $GLOBALS['dbi']->selectDb($oldDb);
            $_message .= $pma_table->getLastMessage();
            $result = true;
            $GLOBALS['table'] = $pma_table->getName();
            $reread_info = true;
            $reload = true;
        } else {
            $_message .= $pma_table->getLastError();
開發者ID:wp-cloud,項目名稱:phpmyadmin,代碼行數:31,代碼來源:tbl_operations.php

示例3: array

/**
 * Gets tables information
 */
require './libraries/tbl_info.inc.php';
$reread_info = false;
/**
 * Updates if required
 */
if (isset($_REQUEST['submitoptions'])) {
    $_message = '';
    $warning_messages = array();
    if (isset($_REQUEST['new_name'])) {
        if ($pma_table->rename($_REQUEST['new_name'])) {
            $_message .= $pma_table->getLastMessage();
            $result = true;
            $GLOBALS['table'] = $pma_table->getName();
            $reread_info = true;
            $reload = true;
        } else {
            $_message .= $pma_table->getLastError();
            $result = false;
        }
    }
}
if (isset($result)) {
    // set to success by default, because result set could be empty
    // (for example, a table rename)
    $_type = 'success';
    if (empty($_message)) {
        $_message = $result ? __('Your SQL query has been executed successfully.') : __('Error');
        // $result should exist, regardless of $_message
開發者ID:pboutin44,項目名稱:maintest,代碼行數:31,代碼來源:view_operations.php


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