home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / tbl_properties_table_info.php < prev    next >
Encoding:
PHP Script  |  2004-06-06  |  1.8 KB  |  63 lines

  1. <?php
  2. /* $Id: tbl_properties_table_info.php,v 2.3.2.1 2004/06/07 10:09:52 rabus Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5. // this should be recoded as functions, to avoid messing with global
  6. // variables
  7.  
  8. // Check parameters
  9.  
  10. require_once('./libraries/common.lib.php');
  11.  
  12. PMA_checkParameters(array('db', 'table'));
  13.  
  14. /**
  15.  * Gets table informations
  16.  */
  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. if (!isset($showtable['Type']) && isset($showtable['Engine'])) {
  22.     $showtable['Type'] =& $showtable['Engine'];
  23. }
  24. $tbl_type            = strtoupper($showtable['Type']);
  25. $tbl_charset         = empty($showtable['Collation']) ? '' : $showtable['Collation'];
  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'] : '');
  29.  
  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];
  36.     }
  37. } // end for
  38. unset($tmp1, $tmp);
  39. mysql_free_result($table_info_result);
  40.  
  41.  
  42. /**
  43.  * Displays top menu links
  44.  */
  45. echo '<!-- top menu -->' . "\n";
  46. require('./tbl_properties_links.php');
  47.  
  48.  
  49. /**
  50.  * Displays table comment
  51.  */
  52. if (!empty($show_comment) && !isset($avoid_show_comment)) {
  53.     ?>
  54. <!-- Table comment -->
  55. <p><i>
  56.     <?php echo htmlspecialchars($show_comment) . "\n"; ?>
  57. </i></p>
  58.     <?php
  59. } // end if
  60.  
  61. echo "\n\n";
  62. ?>
  63.