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


PHP Table::getLastError方法代码示例

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


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

示例1: testGetLastErrorAndMessage

 /**
  * Test getLastError & getLastMessage
  *
  * @return void
  */
 public function testGetLastErrorAndMessage()
 {
     $table = new 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:pboutin44,项目名称:maintest,代码行数:17,代码来源:TableTest.php

示例2: list

     $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();
         $result = false;
     }
 }
 if (!empty($_REQUEST['new_tbl_storage_engine']) && mb_strtoupper($_REQUEST['new_tbl_storage_engine']) !== $tbl_storage_engine) {
     $new_tbl_storage_engine = mb_strtoupper($_REQUEST['new_tbl_storage_engine']);
     // reset the globals for the new engine
     list($is_myisam_or_aria, $is_innodb, $is_isam, $is_berkeleydb, $is_aria, $is_pbxt) = PMA_setGlobalVariablesForEngine($new_tbl_storage_engine);
     if ($is_aria) {
         $create_options['transactional'] = isset($create_options['transactional']) && $create_options['transactional'] == '0' ? '0' : '1';
         $create_options['page_checksum'] = isset($create_options['page_checksum']) ? $create_options['page_checksum'] : '';
     }
 } else {
     $new_tbl_storage_engine = '';
 }
 $table_alters = PMA_getTableAltersArray($is_myisam_or_aria, $is_isam, $create_options['pack_keys'], empty($create_options['checksum']) ? '0' : '1', $is_aria, isset($create_options['page_checksum']) ? $create_options['page_checksum'] : '', empty($create_options['delay_key_write']) ? '0' : '1', $is_innodb, $is_pbxt, $create_options['row_format'], $new_tbl_storage_engine, isset($create_options['transactional']) && $create_options['transactional'] == '0' ? '0' : '1', $tbl_collation);
开发者ID:wp-cloud,项目名称:phpmyadmin,代码行数:31,代码来源:tbl_operations.php

示例3:

$reread_info = false;
/**
 * Updates if required
 */
$_message = new PMA\libraries\Message();
$_type = 'success';
if (isset($_REQUEST['submitoptions'])) {
    if (isset($_REQUEST['new_name'])) {
        if ($pma_table->rename($_REQUEST['new_name'])) {
            $_message->addText($pma_table->getLastMessage());
            $result = true;
            $GLOBALS['table'] = $pma_table->getName();
            $reread_info = true;
            $reload = true;
        } else {
            $_message->addText($pma_table->getLastError());
            $result = false;
        }
    }
    $warning_messages = PMA_getWarningMessagesArray();
}
if (isset($result)) {
    // set to success by default, because result set could be empty
    // (for example, a table rename)
    if (empty($_message->getString())) {
        if ($result) {
            $_message->addText(__('Your SQL query has been executed successfully.'));
        } else {
            $_message->addText(__('Error'));
        }
        // $result should exist, regardless of $_message
开发者ID:phpmyadmin,项目名称:phpmyadmin,代码行数:31,代码来源:view_operations.php


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