bug 617029 for Loic
[phpmyadmin/crack.git] / tbl_properties_table_info.php3
blobb625638337c11c97664c25be0806dc1a7b0b0e3b
1 <?php
2 /* $Id$ */
4 // this should be recoded as functions, to avoid messing with global
5 // variables
7 /**
8 * Gets table informations
9 */
10 // The 'show table' statement works correct since 3.23.03
11 if (PMA_MYSQL_INT_VERSION >= 32303) {
12 $local_query = 'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'';
13 $table_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
14 $showtable = PMA_mysql_fetch_array($table_info_result);
15 $tbl_type = strtoupper($showtable['Type']);
16 $table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
17 $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
19 $tmp = explode(' ', $showtable['Create_options']);
20 $tmp_cnt = count($tmp);
21 for ($i = 0; $i < $tmp_cnt; $i++) {
22 $tmp1 = explode('=', $tmp[$i]);
23 if (isset($tmp1[1])) {
24 $$tmp1[0] = $tmp1[1];
26 } // end for
27 unset($tmp1);
28 unset($tmp);
29 } else {
30 $local_query = 'SELECT COUNT(*) AS count FROM ' . PMA_backquote($table);
31 $table_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
32 $showtable = array();
33 $table_info_num_rows = PMA_mysql_result($table_info_result, 0, 'count');
34 $show_comment = '';
36 mysql_free_result($table_info_result);
39 /**
40 * Displays top menu links
42 echo '<!-- top menu -->' . "\n";
43 require('./tbl_properties_links.php3');
46 /**
47 * Displays table comment
49 if (!empty($show_comment)) {
51 <!-- Table comment -->
52 <p><i>
53 <?php echo htmlspecialchars($show_comment) . "\n"; ?>
54 </i></p>
55 <?php
56 } // end if
58 echo "\n\n";