back to the welcome page
if (!empty($db)) {
$is_db = @mysql_select_db($db);
}
if (empty($db) || !$is_db) {
header('Location: ' . $cfgPmaAbsoluteUri . 'main.php3?lang=' . $lang . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit();
}
// Not a valid table name -> back to the db_details.php3
if (!empty($table)) {
$is_table = @mysql_query('SHOW TABLES LIKE \'' . sql_addslashes($table, TRUE) . '\'');
}
if (empty($table) || !@mysql_numrows($is_table)) {
header('Location: ' . $cfgPmaAbsoluteUri . 'db_details.php3?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
exit();
} else if (isset($is_table)) {
mysql_free_result($is_table);
}
// Displays headers
if (!isset($message)) {
$js_to_run = 'functions.js';
include('./header.inc.php3');
} else {
show_message($message);
}
/**
* Drop/delete mutliple tables if required
*/
if ((!empty($submit_mult) && isset($selected_fld))
|| isset($btnDrop)) {
$action = 'tbl_properties.php3';
include('./mult_submits.inc.php3');
}
/**
* Defines the query to be displayed in the query textarea
*/
if (isset($show_query) && $show_query == 'y') {
// This script has been called by read_dump.php3
if (isset($sql_query_cpy)) {
$query_to_display = $sql_query_cpy;
}
// Other cases
else if (get_magic_quotes_gpc()) {
$query_to_display = stripslashes($sql_query);
}
else {
$query_to_display = $sql_query;
}
} else {
$query_to_display = '';
}
unset($sql_query);
/**
* Set parameters for links
*/
$url_query = 'lang=' . $lang
. '&server=' . $server
. '&db=' . urlencode($db)
. '&table=' . urlencode($table)
. '&goto=tbl_properties.php3';
/**
* Updates table type, comment and order if required
*/
if (isset($submitcomment)) {
if (get_magic_quotes_gpc()) {
$comment = stripslashes($comment);
}
if (empty($prev_comment) || urldecode($prev_comment) != $comment) {
$local_query = 'ALTER TABLE ' . backquote($table) . ' COMMENT = \'' . sql_addslashes($comment) . '\'';
$result = mysql_query($local_query) or mysql_die('', $local_query);
}
}
if (isset($submittype)) {
$local_query = 'ALTER TABLE ' . backquote($table) . ' TYPE = ' . $tbl_type;
$result = mysql_query($local_query) or mysql_die('', $local_query);
}
if (isset($submitorderby) && !empty($order_field)) {
$order_field = backquote(urldecode($order_field));
$local_query = 'ALTER TABLE ' . backquote($table) . 'ORDER BY ' . $order_field;
$result = mysql_query($local_query) or mysql_die('', $local_query);
}
/**
* Gets table informations and displays these informations and also top
* browse/select/insert/empty links
*/
// The 'show table' statement works correct since 3.23.03
if (MYSQL_INT_VERSION >= 32303) {
$local_query = 'SHOW TABLE STATUS LIKE \'' . sql_addslashes($table, TRUE) . '\'';
$result = mysql_query($local_query) or mysql_die('', $local_query);
$showtable = mysql_fetch_array($result);
$tbl_type = strtoupper($showtable['Type']);
$num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
$show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
} else {
$local_query = 'SELECT COUNT(*) AS count FROM ' . backquote($table);
$result = mysql_query($local_query) or mysql_die('', $local_query);
$showtable = array();
$num_rows = mysql_result($result, 0, 'count');
$show_comment = '';
}
mysql_free_result($result);
?>
0) {
echo "\n";
?>
[
]
[
]
[
]
[
]
[
]
[ ]
[ ]
[
]
[ ]
[
]
0 && $row['Key_name'] != $prev_key && $prev_seq == 1) {
unset($ret_keys[$i-1]['Seq_in_index']);
}
$prev_key = $row['Key_name'];
$prev_seq = $row['Seq_in_index'];
// Backups the list of primary keys
if ($row['Key_name'] == 'PRIMARY') {
$primary .= $row['Column_name'] . ', ';
$pk_array[$row['Column_name']] = 1;
}
$i++;
} // end while
// Unset the 'Seq_in_index' value if it's not a composite index - part 2
if ($i > 0 && $row['Key_name'] != $prev_key && $prev_seq == 1) {
unset($ret_keys[$i-1]['Seq_in_index']);
}
mysql_free_result($result);
// 3. Get fields
$local_query = 'SHOW FIELDS FROM ' . backquote($table);
$result = mysql_query($local_query) or mysql_die('', $local_query);
$fields_cnt = mysql_num_rows($result);
/**
* Displays the table structure ('show table' works correct since 3.23.03)
*/
?>
20) {
if ($num_rows > 0) {
?>
[
]
[
]
[
]
[
]
[
]
[ ]
[ ]
[
]
[ ]
[
]
20)
echo "\n\n";
/**
* Displays indexes
*/
?>
0) {
?>
|
|
= 32323) {
echo "\n";
?>
|
|
|
-' . $row['Seq_in_index'] . '-';
} else {
$key_name = htmlspecialchars($row['Key_name']);
}
if (!isset($row['Sub_part'])) {
$row['Sub_part'] = '';
}
if ($row['Key_name'] == 'PRIMARY') {
$sql_query = urlencode('ALTER TABLE ' . backquote($table) . ' DROP PRIMARY KEY');
$js_msg = 'ALTER TABLE ' . js_format($table) . ' DROP PRIMARY KEY';
$zero_rows = urlencode($strPrimaryKey . ' ' . $strHasBeenDropped);
} else {
$sql_query = urlencode('ALTER TABLE ' . backquote($table) . ' DROP INDEX ' . backquote($row['Key_name']));
$js_msg = 'ALTER TABLE ' . js_format($table) . ' DROP INDEX ' . js_format($row['Key_name']);
$zero_rows = urlencode($strIndex . ' ' . htmlspecialchars($row['Key_name']) . ' ' . $strHasBeenDropped);
}
if ($row['Key_name'] != $prev_key) {
$j++;
$prev_key = $row['Key_name'];
}
$bgcolor = ($j % 2) ? $cfgBgcolorOne : $cfgBgcolorTwo;
echo "\n";
?>
|
|
= 32323) {
echo "\n";
?>
|
|
|
|
"
onclick="return confirmLink(this, '')">
|
|
= 32303 && $nonisam == FALSE) {
// Gets some sizes
$mergetable = FALSE;
if (isset($showtable['Type']) && $showtable['Type'] == 'MRG_MyISAM') {
$mergetable = TRUE;
}
list($data_size, $data_unit) = format_byte_down($showtable['Data_length']);
if ($mergetable == FALSE) {
list($index_size, $index_unit) = format_byte_down($showtable['Index_length']);
}
if (isset($showtable['Data_free']) && $showtable['Data_free'] > 0) {
list($free_size, $free_unit) = format_byte_down($showtable['Data_free']);
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length'] - $showtable['Data_free']);
} else {
list($effect_size, $effect_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']);
}
list($tot_size, $tot_unit) = format_byte_down($showtable['Data_length'] + $showtable['Index_length']);
if ($num_rows > 0) {
list($avg_size, $avg_unit) = format_byte_down(($showtable['Data_length'] + $showtable['Index_length']) / $showtable['Rows'], 6, 1);
}
// Displays them
if ($index_count > 0) {
echo ' | ' . "\n";
}
?>
|
|
|
|
|
|
|
|
0) {
echo "\n";
?>
ø |
|
0 && $mergetable == FALSE) {
echo "\n";
?>
ø |
|
Autoindex |
|
|