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


PHP PMA_Table::getLastError方法代碼示例

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


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

示例1: array

$reread_info = false;
$errors = array();
$table_alters = array();
/**
 * Updates table comment, type and options if required
 */
if (isset($_REQUEST['submitoptions'])) {
    $message = '';
    if (isset($_REQUEST['new_name'])) {
        if ($pma_table->rename($_REQUEST['new_name'])) {
            $message .= $pma_table->getLastMessage();
            $GLOBALS['table'] = $pma_table->getName();
            $reread_info = true;
            $reload = true;
        } else {
            $errors[] = $pma_table->getLastError();
            $message .= $pma_table->getLastError();
        }
    }
    if (isset($_REQUEST['comment']) && urldecode($_REQUEST['prev_comment']) !== $_REQUEST['comment']) {
        $table_alters[] = 'COMMENT = \'' . PMA_sqlAddslashes($_REQUEST['comment']) . '\'';
    }
    if (!empty($_REQUEST['new_tbl_type']) && strtolower($_REQUEST['new_tbl_type']) !== strtolower($tbl_type)) {
        $table_alters[] = PMA_ENGINE_KEYWORD . ' = ' . $_REQUEST['new_tbl_type'];
        $tbl_type = $_REQUEST['new_tbl_type'];
    }
    if (!empty($_REQUEST['tbl_collation']) && $_REQUEST['tbl_collation'] !== $tbl_collation) {
        $table_alters[] = 'DEFAULT ' . PMA_generateCharsetQueryPart($_REQUEST['tbl_collation']);
    }
    $l_tbl_type = strtolower($tbl_type);
    if (($l_tbl_type === 'myisam' || $l_tbl_type === 'isam') && isset($_REQUEST['new_pack_keys']) && $_REQUEST['new_pack_keys'] != (string) $pack_keys) {
開發者ID:Kishaaa,項目名稱:cs160-website,代碼行數:31,代碼來源:tbl_operations.php

示例2: array

/**
 * Updates if required
 */
if (isset($_REQUEST['submitoptions'])) {
    $_message = '';
    $warning_messages = array();

    if (isset($_REQUEST['new_name'])) {
        if ($pma_table->rename($_REQUEST['new_name'], null, $is_view = true)) {
            $_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
        $_type = $result ? 'success' : 'error';
    }
    if (! empty($warning_messages)) {
開發者ID:nicokaiser,項目名稱:phpmyadmin,代碼行數:31,代碼來源:view_operations.php

示例3: testGetLastErrorAndMessage

 /**
  * Test getLastError & getLastMessage
  *
  * @return void
  */
 public function testGetLastErrorAndMessage()
 {
     $table = new PMA_Table('table1', 'pma_test');
     $table->errors[] = "error1";
     $table->errors[] = "error2";
     $table->errors[] = "error3";
     $table->messages[] = "messages1";
     $table->messages[] = "messages2";
     $table->messages[] = "messages3";
     $this->assertEquals("error3", $table->getLastError());
     $this->assertEquals("messages3", $table->getLastMessage());
 }
開發者ID:nervo,項目名稱:phpmyadmin,代碼行數:17,代碼來源:PMA_Table_test.php


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