diff --git a/tbl_properties.php3 b/tbl_properties.php3 index a228ecb7c9..375a8bd704 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -77,39 +77,53 @@ $url_query = 'lang=' . $lang /** - * Gets table informations + * Updates table type, comment and order if required */ -// 1. Get table type and comments ('show table' works correct since 3.23.03) -if (MYSQL_INT_VERSION >= 32303) { - // Update table type, comment and order if required by the user - if (isset($submitcomment)) { - if (get_magic_quotes_gpc()) { - $comment = stripslashes($comment); - } - if (empty($prev_comment) || urldecode($prev_comment) != str_replace('"', '"', $comment)) { - $local_query = 'ALTER TABLE ' . backquote($table) . ' COMMENT = \'' . sql_addslashes($comment) . '\''; - $result = mysql_query($local_query) or mysql_die('', $local_query); - } +if (isset($submitcomment)) { + if (get_magic_quotes_gpc()) { + $comment = stripslashes($comment); } - if (isset($submittype)) { - $local_query = 'ALTER TABLE ' . backquote($table) . ' TYPE = ' . $tbl_type; + 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($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); - } - - // Get table type and comments and displays first browse links - $local_query = 'SHOW TABLE STATUS LIKE \'' . sql_addslashes($table, TRUE) . '\''; +} +if (isset($submittype)) { + $local_query = 'ALTER TABLE ' . backquote($table) . ' TYPE = ' . $tbl_type; $result = mysql_query($local_query) or mysql_die('', $local_query); - $showtable = mysql_fetch_array($result); - $tbl_type = strtoupper($showtable['Type']); +} +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); +} - if (isset($showtable['Rows']) && $showtable['Rows'] > 0) { - echo "\n"; - ?> + +/** + * 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 = ''; +} +?> + + 0) { + echo "\n"; + ?>
- +[ ] @@ -140,27 +154,18 @@ if (MYSQL_INT_VERSION >= 32303) { onclick="return confirmLink(this, 'DROP TABLE ')"> ]
- +- 1) { +if ($fields_cnt > 1) { ?>