本文整理汇总了PHP中PMA_DBI_data_seek函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_DBI_data_seek函数的具体用法?PHP PMA_DBI_data_seek怎么用?PHP PMA_DBI_data_seek使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_DBI_data_seek函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_displayTable
//.........这里部分代码省略.........
// we need $sort_expression and $sort_expression_nodirection
// even if there are many table references
if (!empty($analyzed_sql[0]['order_by_clause'])) {
$sort_expression = trim(str_replace(' ', ' ', $analyzed_sql[0]['order_by_clause']));
/**
* Get rid of ASC|DESC
*/
preg_match('@(.*)([[:space:]]*(ASC|DESC))@si', $sort_expression, $matches);
$sort_expression_nodirection = isset($matches[1]) ? trim($matches[1]) : $sort_expression;
$sort_direction = isset($matches[2]) ? trim($matches[2]) : '';
unset($matches);
} else {
$sort_expression = $sort_expression_nodirection = $sort_direction = '';
}
// 1.4 Prepares display of first and last value of the sorted column
if (!empty($sort_expression_nodirection)) {
list($sort_table, $sort_column) = explode('.', $sort_expression_nodirection);
$sort_table = PMA_unQuote($sort_table);
$sort_column = PMA_unQuote($sort_column);
// find the sorted column index in row result
// (this might be a multi-table query)
$sorted_column_index = false;
foreach ($fields_meta as $key => $meta) {
if ($meta->table == $sort_table && $meta->name == $sort_column) {
$sorted_column_index = $key;
break;
}
}
if ($sorted_column_index !== false) {
// fetch first row of the result set
$row = PMA_DBI_fetch_row($dt_result);
$column_for_first_row = substr($row[$sorted_column_index], 0, $GLOBALS['cfg']['LimitChars']);
// fetch last row of the result set
PMA_DBI_data_seek($dt_result, $num_rows - 1);
$row = PMA_DBI_fetch_row($dt_result);
$column_for_last_row = substr($row[$sorted_column_index], 0, $GLOBALS['cfg']['LimitChars']);
// reset to first row for the loop in PMA_displayTableBody()
PMA_DBI_data_seek($dt_result, 0);
// we could also use here $sort_expression_nodirection
$sorted_column_message = ' [' . htmlspecialchars($sort_column) . ': <strong>' . htmlspecialchars($column_for_first_row) . ' - ' . htmlspecialchars($column_for_last_row) . '</strong>]';
unset($row, $column_for_first_row, $column_for_last_row);
}
unset($sorted_column_index, $sort_table, $sort_column);
}
// 2. ----- Displays the top of the page -----
// 2.1 Displays a messages with position informations
if ($is_display['nav_bar'] == '1' && isset($pos_next)) {
if (isset($unlim_num_rows) && $unlim_num_rows != $total) {
$selectstring = ', ' . $unlim_num_rows . ' ' . $GLOBALS['strSelectNumRows'];
} else {
$selectstring = '';
}
$last_shown_rec = $_SESSION['tmp_user_values']['max_rows'] == 'all' || $pos_next > $total ? $total - 1 : $pos_next - 1;
if (PMA_Table::isView($db, $table) && $total == $GLOBALS['cfg']['MaxExactCountViews']) {
$message = PMA_Message::notice('strViewHasAtLeast');
$message->addParam('[a@./Documentation.html#cfg_MaxExactCount@_blank]');
$message->addParam('[/a]');
$message_view_warning = PMA_showHint($message);
} else {
$message_view_warning = false;
}
$message = PMA_Message::success('strShowingRecords');
$message->addMessage($_SESSION['tmp_user_values']['pos']);
if ($message_view_warning) {
$message->addMessage('...', ' - ');
$message->addMessage($message_view_warning);
示例2: PMA_DBI_data_seek
?>
</th>
<th><?php
echo $strStatus;
?>
</th>
<th><?php
echo $strShow;
?>
</th>
</tr>
</thead>
<tbody>
<?php
$style = 'odd';
PMA_DBI_data_seek($sql_result, 0);
while ($version = PMA_DBI_fetch_array($sql_result)) {
if ($version['tracking_active'] == 1) {
$version_status = $strTrackingStatusActive;
} else {
$version_status = $strTrackingStatusNotActive;
}
if ($version['version'] == $last_version && $version_status == $strTrackingStatusNotActive) {
$tracking_active = false;
}
if ($version['version'] == $last_version && $version_status == $strTrackingStatusActive) {
$tracking_active = true;
}
?>
<tr class="<?php
echo $style;
示例3: _getMultiRowOperationLinks
/**
* Prepare multi field edit/delete links
*
* @param integer &$dt_result the link id associated to the query
* which results have to be displayed
* @param array $analyzed_sql the analyzed query
* @param string $del_link the display element - 'del_link'
*
* @return string $links_html html content
*
* @access private
*
* @see getTable()
*/
private function _getMultiRowOperationLinks(&$dt_result, $analyzed_sql, $del_link)
{
$links_html = '';
$url_query = $this->__get('_url_query');
$delete_text = $del_link == self::DELETE_ROW ? __('Delete') : __('Kill');
$_url_params = array('db' => $this->__get('_db'), 'table' => $this->__get('_table'), 'sql_query' => $this->__get('_sql_query'), 'goto' => $this->__get('_goto'));
if ($_SESSION['tmp_user_values']['disp_direction'] != self::DISP_DIR_VERTICAL) {
$links_html .= '<img class="selectallarrow" width="38" height="22"' . ' src="' . $this->__get('_pma_theme_image') . 'arrow_' . $this->__get('_text_dir') . '.png' . '"' . ' alt="' . __('With selected:') . '" />';
}
$links_html .= '<input type="checkbox" id="checkall" title="' . __('Check All') . '" /> ' . '<label for="checkall">' . __('Check All') . '</label> ' . '<i style="margin-left: 2em">' . __('With selected:') . '</i>' . "\n";
$links_html .= $this->getCommonFunctions()->getButtonOrImage('submit_mult', 'mult_submit', 'submit_mult_change', __('Change'), 'b_edit.png', 'edit');
$links_html .= $this->getCommonFunctions()->getButtonOrImage('submit_mult', 'mult_submit', 'submit_mult_delete', $delete_text, 'b_drop.png', 'delete');
if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == self::QUERY_TYPE_SELECT) {
$links_html .= $this->getCommonFunctions()->getButtonOrImage('submit_mult', 'mult_submit', 'submit_mult_export', __('Export'), 'b_tblexport.png', 'export');
}
$links_html .= "\n";
$links_html .= '<input type="hidden" name="sql_query"' . ' value="' . htmlspecialchars($this->__get('_sql_query')) . '" />' . "\n";
if (!empty($url_query)) {
$links_html .= '<input type="hidden" name="url_query"' . ' value="' . $url_query . '" />' . "\n";
}
// fetch last row of the result set
PMA_DBI_data_seek($dt_result, $this->__get('_num_rows') - 1);
$row = PMA_DBI_fetch_row($dt_result);
// $clause_is_unique is needed by getTable() to generate the proper param
// in the multi-edit and multi-delete form
list($where_clause, $clause_is_unique, $condition_array) = $this->getCommonFunctions()->getUniqueCondition($dt_result, $this->__get('_fields_cnt'), $this->__get('_fields_meta'), $row);
// reset to first row for the loop in _getTableBody()
PMA_DBI_data_seek($dt_result, 0);
$links_html .= '<input type="hidden" name="clause_is_unique"' . ' value="' . $clause_is_unique . '" />' . "\n";
$links_html .= '</form>' . "\n";
return $links_html;
}