update
[phpmyadmin/crack.git] / tbl_properties_table_info.php3
bloba69f8544c38652ebed3bb3ad90330d13b0628e06
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 /**
9 * Gets table informations
11 // The 'show table' statement works correct since 3.23.03
12 if (PMA_MYSQL_INT_VERSION >= 32303) {
13 $local_query = 'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'';
14 $table_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
15 $showtable = PMA_mysql_fetch_array($table_info_result);
16 $tbl_type = strtoupper($showtable['Type']);
17 $tbl_charset = empty($showtable['Charset']) ? '' : $showtable['Charset'];
18 $table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
19 $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
20 $auto_increment = (isset($showtable['Auto_increment']) ? $showtable['Auto_increment'] : '');
22 $tmp = explode(' ', $showtable['Create_options']);
23 $tmp_cnt = count($tmp);
24 for ($i = 0; $i < $tmp_cnt; $i++) {
25 $tmp1 = explode('=', $tmp[$i]);
26 if (isset($tmp1[1])) {
27 $$tmp1[0] = $tmp1[1];
29 } // end for
30 unset($tmp1);
31 unset($tmp);
32 } else {
33 $local_query = 'SELECT COUNT(*) AS count FROM ' . PMA_backquote($table);
34 $table_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
35 $showtable = array();
36 $table_info_num_rows = PMA_mysql_result($table_info_result, 0, 'count');
37 $show_comment = '';
39 mysql_free_result($table_info_result);
42 /**
43 * Displays top menu links
45 echo '<!-- top menu -->' . "\n";
46 require('./tbl_properties_links.php3');
49 /**
50 * Displays table comment
52 if (!empty($show_comment)) {
54 <!-- Table comment -->
55 <p><i>
56 <?php echo htmlspecialchars($show_comment) . "\n"; ?>
57 </i></p>
58 <?php
59 } // end if
61 echo "\n\n";