selectDb($db); $result = $GLOBALS['dbi']->query( 'SHOW KEYS FROM ' . PMA_Util::backquote($table) . ';' ); $primary = ''; while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { // Backups the list of primary keys if ($row['Key_name'] == 'PRIMARY') { $primary .= $row['Column_name'] . ', '; } } // end while $GLOBALS['dbi']->freeResult($result); return $primary; } /** * Gets HTML for replace_prefix_tbl or copy_tbl_change_prefix * * @param string $what mult_submit type * @param string $action action type * @param array $_url_params URL params * * @return string */ function PMA_getHtmlForReplacePrefixTable($what, $action, $_url_params) { $html = '
'; $html .= PMA_URL_getHiddenInputs($_url_params); $html .= '
'; $html .= ''; if ($what == 'replace_prefix_tbl') { $html .= __('Replace table prefix:'); } else { $html .= __('Copy table with prefix:'); } $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
' . __('From') . ''; $html .= ''; $html .= '
' . __('To') . ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; return $html; } /** * Gets HTML for add_prefix_tbl * * @param string $action action type * @param array $_url_params URL params * * @return string */ function PMA_getHtmlForAddPrefixTable($action, $_url_params) { $html = '
'; $html .= PMA_URL_getHiddenInputs($_url_params); $html .= '
'; $html .= '' . __('Add table prefix:') . ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
' . __('Add prefix') . ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; return $html; } /** * Gets HTML for other mult_submits actions * * @param string $what mult_submit type * @param string $action action type * @param array $_url_params URL params * @param array $full_query full sql query string * * @return string */ function PMA_getHtmlForOtherActions($what, $action, $_url_params, $full_query) { $html = '
'; $html .= ''; if ($what == 'drop_db') { $html .= __('You are about to DESTROY a complete database!') . ' '; } $html .= __('Do you really want to execute the following query?'); $html .= ''; $html .= '' . $full_query . ''; $html .= '
'; $html .= '
'; $html .= '
'; $html .= PMA_URL_getHiddenInputs($_url_params); // Display option to disable foreign key checks while dropping tables if ($what == 'drop_tbl') { $html .= '
'; $html .= ''; $html .= __('Foreign key check:'); $html .= ''; $html .= ''; $html .= 'fetchValue( 'SHOW VARIABLES LIKE \'foreign_key_checks\';', 0, 1 ) == 'ON'; if ($default_fk_check_value) { $html .= ' checked="checked"'; } $html .= '/>'; $html .= ''; $html .= ($default_fk_check_value) ? __('(Enabled)') : __('(Disabled)'); $html .= ''; $html .= '
'; } $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; $html .= PMA_URL_getHiddenInputs($_url_params); $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; return $html; } ?>