Initial import.
[openemr.git] / interface / main / myadmin / tbl_properties_table_info.php
blobd54d19db9d514073d3bdeda8a6f28a177a37ca49
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 require_once('./libraries/common.lib.php');
12 PMA_checkParameters(array('db', 'table'));
14 /**
15 * Gets table informations
17 // The 'show table' statement works correct since 3.23.03
18 $local_query = 'SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\'';
19 $table_info_result = PMA_mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $err_url_0);
20 $showtable = PMA_mysql_fetch_array($table_info_result);
21 $tbl_type = strtoupper($showtable['Type']);
22 $tbl_charset = empty($showtable['Charset']) ? '' : $showtable['Charset'];
23 $table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
24 $show_comment = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
25 $auto_increment = (isset($showtable['Auto_increment']) ? $showtable['Auto_increment'] : '');
27 $tmp = explode(' ', $showtable['Create_options']);
28 $tmp_cnt = count($tmp);
29 for ($i = 0; $i < $tmp_cnt; $i++) {
30 $tmp1 = explode('=', $tmp[$i]);
31 if (isset($tmp1[1])) {
32 $$tmp1[0] = $tmp1[1];
34 } // end for
35 unset($tmp1, $tmp);
36 mysql_free_result($table_info_result);
39 /**
40 * Displays top menu links
42 echo '<!-- top menu -->' . "\n";
43 require('./tbl_properties_links.php');
46 /**
47 * Displays table comment
49 if (!empty($show_comment) && !isset($avoid_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";