本文整理汇总了PHP中PMA_Table::getReservedColumnNames方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Table::getReservedColumnNames方法的具体用法?PHP PMA_Table::getReservedColumnNames怎么用?PHP PMA_Table::getReservedColumnNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Table
的用法示例。
在下文中一共展示了PMA_Table::getReservedColumnNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_getReservedWordColumnNameMessages
/**
* Check column names for MySQL reserved words
*
* @param string $db database name
* @param string $table tablename
*
* @return array $messages array of PMA_Messages
*/
function PMA_getReservedWordColumnNameMessages($db, $table)
{
$messages = array();
if ($GLOBALS['cfg']['ReservedWordDisableWarning'] === false) {
$pma_table = new PMA_Table($table, $db);
$columns = $pma_table->getReservedColumnNames();
if (!empty($columns)) {
foreach ($columns as $column) {
$msg = PMA_message::notice(__('The column name \'%s\' is a MySQL reserved keyword.'));
$msg->addParam($column);
$messages[] = $msg;
}
}
}
return $messages;
}
示例2: testGetColumns
/**
* Test for getColumns
*
* @return void
*/
public function testGetColumns()
{
$table = 'PMA_BookMark';
$db = 'PMA';
$table = new PMA_Table($table, $db);
$return = $table->getColumns();
$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);
$return = $table->getReservedColumnNames();
$expect = array('ACCESSIBLE', 'ADD', 'ALL');
$this->assertEquals($expect, $return);
}
示例3: foreach
}
/**
* Gets the relation settings
*/
$cfgRelation = PMA_getRelationsParam();
/**
* Runs common work
*/
require_once 'libraries/tbl_common.inc.php';
$url_query .= '&goto=tbl_structure.php&back=tbl_structure.php';
$url_params['goto'] = 'tbl_structure.php';
$url_params['back'] = 'tbl_structure.php';
// Check column names for MySQL reserved words
if ($cfg['ReservedWordDisableWarning'] === false) {
$pma_table = new PMA_Table($table, $db);
$columns = $pma_table->getReservedColumnNames();
if (!empty($columns)) {
foreach ($columns as $column) {
$msg = PMA_message::notice(__('The column name \'%s\' is a MySQL reserved keyword.'));
$msg->addParam($column);
$response->addHTML($msg);
}
}
}
/**
* Prepares the table structure display
*/
/**
* Gets tables informations
*/
require_once 'libraries/tbl_info.inc.php';