update
[phpmyadmin/crack.git] / tbl_properties_table_info.php3
blob359f863660789d8386b5e3d5d0ccb031fd541549
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 $table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
18 $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
20 $tmp = explode(' ', $showtable['Create_options']);
21 $tmp_cnt = count($tmp);
22 for ($i = 0; $i < $tmp_cnt; $i++) {
23 $tmp1 = explode('=', $tmp[$i]);
24 if (isset($tmp1[1])) {
25 $$tmp1[0] = $tmp1[1];
27 } // end for
28 unset($tmp1);
29 unset($tmp);
30 } else {
31 $local_query = 'SELECT COUNT(*) AS count FROM ' . PMA_backquote($table);
32 $table_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
33 $showtable = array();
34 $table_info_num_rows = PMA_mysql_result($table_info_result, 0, 'count');
35 $show_comment = '';
37 mysql_free_result($table_info_result);
40 /**
41 * Displays top menu links
43 echo '<!-- top menu -->' . "\n";
44 require('./tbl_properties_links.php3');
47 /**
48 * Displays table comment
50 if (!empty($show_comment)) {
52 <!-- Table comment -->
53 <p><i>
54 <?php echo htmlspecialchars($show_comment) . "\n"; ?>
55 </i></p>
56 <?php
57 } // end if
59 echo "\n\n";