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(); } } // end if (ensures db exists) if (!isset($is_table) || !$is_table) { // Not a valid table name -> back to the db_details.php3 if (!empty($table)) { $is_table = @mysql_query('SHOW TABLES LIKE \'' . PMA_sqlAddslashes($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); } } // end if (ensures table exists) // Displays headers if (!isset($message)) { $js_to_run = 'functions.js'; include('./header.inc.php3'); } else { PMA_showMessage($message); } /** * Drop/delete mutliple tables if required */ if ((!empty($submit_mult) && isset($selected_fld)) || isset($mult_btn)) { $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 ' . PMA_backquote($table) . ' COMMENT = \'' . PMA_sqlAddslashes($comment) . '\''; $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url); } } if (isset($submittype)) { $local_query = 'ALTER TABLE ' . PMA_backquote($table) . ' TYPE = ' . $tbl_type; $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url); } if (isset($submitorderby) && !empty($order_field)) { $order_field = PMA_backquote(urldecode($order_field)); $local_query = 'ALTER TABLE ' . PMA_backquote($table) . 'ORDER BY ' . $order_field; $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url); } /** * 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 (PMA_MYSQL_INT_VERSION >= 32303) { $local_query = 'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\''; $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0); $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 ' . PMA_backquote($table); $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0); $showtable = array(); $num_rows = mysql_result($result, 0, 'count'); $show_comment = ''; } mysql_free_result($result); ?> 0) { echo "\n"; ?>
20) { if ($num_rows > 0) { ?> 20) echo "\n\n"; /** * Displays indexes */ ?>