bug 780516
[phpmyadmin/crack.git] / tbl_properties_table_info.php3
blob8faf3474e57aba63b21e40ee4665725f0f926cc2
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
5 // this should be recoded as functions, to avoid messing with global
6 // variables
8 // Check parameters
10 if (!defined('PMA_COMMON_LIB_INCLUDED')) {
11 include('./libraries/common.lib.php3');
14 PMA_checkParameters(array('db', 'table'));
16 /**
17 * Gets table informations
19 // The 'show table' statement works correct since 3.23.03
20 if (PMA_MYSQL_INT_VERSION >= 32303) {
21 $local_query = 'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'';
22 $table_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
23 $showtable = PMA_mysql_fetch_array($table_info_result);
24 $tbl_type = strtoupper($showtable['Type']);
25 $tbl_charset = empty($showtable['Charset']) ? '' : $showtable['Charset'];
26 $table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
27 $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
28 $auto_increment = (isset($showtable['Auto_increment']) ? $showtable['Auto_increment'] : '');
30 $tmp = explode(' ', $showtable['Create_options']);
31 $tmp_cnt = count($tmp);
32 for ($i = 0; $i < $tmp_cnt; $i++) {
33 $tmp1 = explode('=', $tmp[$i]);
34 if (isset($tmp1[1])) {
35 $$tmp1[0] = $tmp1[1];
37 } // end for
38 unset($tmp1);
39 unset($tmp);
40 } else {
41 $local_query = 'SELECT COUNT(*) AS count FROM ' . PMA_backquote($table);
42 $table_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
43 $showtable = array();
44 $table_info_num_rows = PMA_mysql_result($table_info_result, 0, 'count');
45 $show_comment = '';
47 mysql_free_result($table_info_result);
50 /**
51 * Displays top menu links
53 echo '<!-- top menu -->' . "\n";
54 require('./tbl_properties_links.php3');
57 /**
58 * Displays table comment
60 if (!empty($show_comment)) {
62 <!-- Table comment -->
63 <p><i>
64 <?php echo htmlspecialchars($show_comment) . "\n"; ?>
65 </i></p>
66 <?php
67 } // end if
69 echo "\n\n";