本文整理汇总了PHP中PMA_Index::getColumnCount方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Index::getColumnCount方法的具体用法?PHP PMA_Index::getColumnCount怎么用?PHP PMA_Index::getColumnCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Index
的用法示例。
在下文中一共展示了PMA_Index::getColumnCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
/**
* Display the form to edit/create an index
*/
// Displays headers (if needed)
$GLOBALS['js_include'][] = 'functions.js';
$GLOBALS['js_include'][] = 'indexes.js';
require_once './libraries/tbl_info.inc.php';
require_once './libraries/tbl_links.inc.php';
if (isset($_REQUEST['index']) && is_array($_REQUEST['index'])) {
// coming already from form
$add_fields =
count($_REQUEST['index']['columns']['names']) - $index->getColumnCount();
if (isset($_REQUEST['add_fields'])) {
$add_fields += $_REQUEST['added_fields'];
}
} elseif (isset($_REQUEST['create_index'])) {
$add_fields = $_REQUEST['added_fields'];
} else {
$add_fields = 1;
}
// end preparing form values
?>
<form action="./tbl_indexes.php" method="post" name="index_frm"
onsubmit="if (typeof(this.elements['index'].disabled) != 'undefined') {
this.elements['index'].disabled = false}">
示例2: PMA_getNumberOfFieldsForForm
/**
* Function to get the number of fields for the form
*
* @param PMA_Index $index index
*
* @return int
*/
function PMA_getNumberOfFieldsForForm($index)
{
if (isset($_REQUEST['index']) && is_array($_REQUEST['index'])) {
// coming already from form
$add_fields = isset($_REQUEST['index']['columns']['names']) ? count($_REQUEST['index']['columns']['names']) - $index->getColumnCount() : 0;
if (isset($_REQUEST['add_fields'])) {
$add_fields += $_REQUEST['added_fields'];
}
} elseif (isset($_REQUEST['create_index'])) {
$add_fields = $_REQUEST['added_fields'];
} else {
$add_fields = 0;
}
// end preparing form values
return $add_fields;
}
示例3: testAddColumns
/**
* Test for add Columns
*
* @return void
*/
public function testAddColumns()
{
$index = new PMA_Index();
$index->addColumns($this->_params['columns']);
$this->assertTrue($index->hasColumn("column1"));
$this->assertTrue($index->hasColumn("column2"));
$this->assertTrue($index->hasColumn("column3"));
$this->assertEquals(3, $index->getColumnCount());
}