home *** CD-ROM | disk | FTP | other *** search
/ Freelog 70 / Freelog070.iso / Internet / EasyPHP / easyphp1-8_setup.exe / {app} / phpmyadmin / tbl_properties_table_info.php < prev    next >
Encoding:
PHP Script  |  2004-10-21  |  1.5 KB  |  40 lines

  1. <?php
  2. /* $Id: tbl_properties_table_info.php,v 2.9 2004/10/21 10:18:12 nijel 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. $table_info_result   = PMA_DBI_query('SHOW TABLE STATUS LIKE \'' . PMA_sqlAddslashes($table, TRUE) . '\';');
  19. $showtable           = PMA_DBI_fetch_assoc($table_info_result);
  20. if (!isset($showtable['Type']) && isset($showtable['Engine'])) {
  21.     $showtable['Type'] =& $showtable['Engine'];
  22. }
  23. $tbl_type            = isset($showtable['Type']) ? strtoupper($showtable['Type']) : '';
  24. $tbl_collation       = empty($showtable['Collation']) ? '' : $showtable['Collation'];
  25. $table_info_num_rows = (isset($showtable['Rows']) ? $showtable['Rows'] : 0);
  26. $show_comment        = (isset($showtable['Comment']) ? $showtable['Comment'] : '');
  27. $auto_increment      = (isset($showtable['Auto_increment']) ? $showtable['Auto_increment'] : '');
  28.  
  29. $tmp                 = isset($showtable['Create_options']) ? explode(' ', $showtable['Create_options']) : array();
  30. $tmp_cnt             = count($tmp);
  31. for ($i = 0; $i < $tmp_cnt; $i++) {
  32.     $tmp1            = explode('=', $tmp[$i]);
  33.     if (isset($tmp1[1])) {
  34.         $$tmp1[0]    = $tmp1[1];
  35.     }
  36. } // end for
  37. unset($tmp1, $tmp);
  38. PMA_DBI_free_result($table_info_result);
  39. ?>
  40.