本文整理汇总了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());
}
示例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);
示例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