diff --git a/ChangeLog b/ChangeLog index 7726b296e..1db8d99be 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,12 @@ phpMyAdmin - Changelog $Id$ $Source$ +2001-07-08 Loïc Chapeaux + * lib.inc.php3, line 742: Documentation is now loaded in its own window. + * db_details.php3: rewritten the script so it fits XHTML1.0 and PEAR + standards, limit the number of "options" displayed if the is no table + in the db and beautity a bit the display. + 2001-07-07 Armel Fauveau * add gzip dump feature (Feature #420812) diff --git a/db_details.php3 b/db_details.php3 index 886bc6354..2fddfbfc2 100755 --- a/db_details.php3 +++ b/db_details.php3 @@ -1,285 +1,414 @@ 0 && MYSQL_MAJOR_VERSION>=3.23 && intval(MYSQL_MINOR_VERSION)>=3){ - // Special speedup for newer MySQL Versions - if ($cfgSkipLockedTables==true && MYSQL_MAJOR_VERSION==3.23 && intval(MYSQL_MINOR_VERSION)>=30){ // in 4.0 format changed - $query="SHOW OPEN TABLES from " . db_name($db); - $result=mysql_query($query); - // Blending out tables in use - if ($result!=false && mysql_num_rows($result)>0){ - while ($tmp=mysql_fetch_array($result)){ - if (preg_match("/in_use=[1-9]+/",$tmp['Comment'])){ // in use? - // memorize tablename - $sot_cache[$tmp[0]]=true; - } - } - mysql_free_result($result); +if ($num_tables > 0 && MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 3) { + // Special speedup for newer MySQL Versions (in 4.0 format changed) + if ($cfgSkipLockedTables == true && MYSQL_MAJOR_VERSION == 3.23 && intval(MYSQL_MINOR_VERSION) >= 30) { + $query = 'SHOW OPEN TABLES FROM ' . db_name($db); + $result = mysql_query($query); + // Blending out tables in use + if ($result != false && mysql_num_rows($result) > 0) { + while ($tmp = mysql_fetch_array($result)) { + // if in use memorize tablename + if (preg_match('/in_use=[1-9]+/', $tmp['Comment'])) { + $sot_cache[$tmp[0]] = true; + } + } + mysql_free_result($result); - if (isset($sot_cache)){ - $query="show tables from " . db_name($db); - $result=mysql_query($query); - if ($result!=false && mysql_num_rows($result)>0){ - while ($tmp=mysql_fetch_array($result)){ - if (!isset($sot_cache[$tmp[0]])){ - $sts_result=mysql_query("show table status from " . db_name($db) . " like '".AddSlashes($tmp[0])."'"); - $sts_tmp=mysql_fetch_array($sts_result); - $tbl_cache[]=$sts_tmp; - } - else{ // table in use - - $tbl_cache[]=array("Name"=>$tmp[0]); - } - } - mysql_free_result($result); - $sot_ready=true; - } - } - } - } - if (!isset($sot_ready)){ - $result=mysql_query("show table status from " .db_name($db)); - if ($result!=false && mysql_num_rows($result)>0){ - while ($sts_tmp=mysql_fetch_array($result)){ - $tbl_cache[]=$sts_tmp; - } - mysql_free_result($result); - } - } + if (isset($sot_cache)) { + $query = 'SHOW TABLES FROM ' . db_name($db); + $result = mysql_query($query); + if ($result != false && mysql_num_rows($result) > 0) { + while ($tmp = mysql_fetch_array($result)) { + if (!isset($sot_cache[$tmp[0]])) { + $sts_result = mysql_query('SHOW TABLE STATUS FROM ' . db_name($db) . ' LIKE \'' . addslashes($tmp[0]) . '\''); + $sts_tmp = mysql_fetch_array($sts_result); + $tbl_cache[] = $sts_tmp; + } else { // table in use + $tbl_cache[] = array('Name' => $tmp[0]); + } + } + mysql_free_result($result); + $sot_ready = true; + } + } + } + } + if (!isset($sot_ready)) { + $result = mysql_query('SHOW TABLE STATUS FROM ' . db_name($db)); + if ($result != false && mysql_num_rows($result) > 0) { + while ($sts_tmp = mysql_fetch_array($result)) { + $tbl_cache[] = $sts_tmp; + } + mysql_free_result($result); + } + } } -if($num_tables == 0) -{ - echo $strNoTablesFound; +// 2. Displays tables +if ($num_tables == 0) { + echo $strNoTablesFound . "\n"; } // show table size on mysql >= 3.23 - staybyte - 11 June 2001 -else if (MYSQL_MAJOR_VERSION>=3.23 && isset($tbl_cache)){ - echo "\n"; - echo ""; - echo ""; - echo ""; - // temporary - if (!empty($strSize)) echo ""; - else echo ""; - $i=$sum_entries=$sum_size=0; - while (list($keyname,$sts_data)=each($tbl_cache)){ - $table=$sts_data["Name"]; - $query = "?server=$server&lang=$lang&db=$db&table=$table&goto=db_details.php3"; - $bgcolor = $cfgBgcolorOne; - $i++ % 2 ? 0: $bgcolor = $cfgBgcolorTwo; - echo "\n"; -?> - - - - - - - -".number_format($sts_data["Rows"], 0, $number_decimal_separator, $number_thousands_separator)."\n"; - $tblsize=$sts_data["Data_length"]+$sts_data["Index_length"]; - $sum_size+=$tblsize; - $sum_entries+=$sts_data["Rows"]; - list($formated_size,$unit)=format_byte_down($tblsize,3,1); - echo "\n"; - } - else{ - echo "\n"; - } - echo "\n"; - } - // Show Summary - echo "\n"; - echo "\n"; - list ($sum_formated,$unit)=format_byte_down($sum_size,3,1); - echo "\n"; - echo "\n"; - echo "\n"; +else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) { + ?> - echo "
".UCFirst($strTable)."$strAction$strRecords$strSize 
&pos=0">&zero_rows=">&zero_rows=">  "; - echo ""; - echo "$formated_size $unit"; - if (!empty($strInUse)) echo $strInUse; - echo "
"; - if (!empty($strSum)) echo $strSum; - echo "".number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator)."$sum_formated $unit
\n"; -} -else -{ - $i = 0; - echo "\n"; - echo ""; - echo ""; - echo ""; - while($i < $num_tables) - { - $table = mysql_tablename($tables, $i); - $query = "?server=$server&lang=$lang&db=$db&table=$table&goto=db_details.php3"; - $bgcolor = $cfgBgcolorOne; - $i % 2 ? 0: $bgcolor = $cfgBgcolorTwo; + + + +
".UCFirst($strTable)."$strAction$strRecords
+ + + + + - + + + + + + + + + + + + + + + + + + + + + +
+ + + &pos=0"> + + + + + + + + &zero_rows="> + + &zero_rows="> + + + +    + + + +
+ + + + + +
+ = 3.23 - - &pos=0"> - - - - &zero_rows="> - &zero_rows="> -   - +else { + $i = 0; + echo "\n"; + ?> + + + + + + + + + + + + + + + + + + + + +
+ + + &pos=0"> + + + + + + + + &zero_rows="> + + &zero_rows="> + + +
+ \n"; -} $query = "?server=$server&lang=$lang&db=$db&goto=db_details.php3"; +echo "\n"; ?> -
-
+
+ + + + +
    -
  • -
  • -
    - - - - - - -:
    -
    -$strOr $strLocationTextfile";?>:
    -
    + 0) { + ?> + +
  • + +
  • + + + +
  • + + + + + + + +  :
    +
    + $strOr $strLocationTextfile"; ?> :
    +
    0) - { - echo "$strOr $strBookmarkQuery:
    \n"; - echo "' . "\n"; + echo ' ' . "\n"; + while(list($key,$value) = each($bookmark_list)) { + echo ' ' . "\n"; } - echo "\n"; - echo "".$strSubmit; - echo "".$strBookmarkView; - echo "".$strDelete; - echo "
    \n"; + echo ' ' . "\n"; + echo ' ' . $strSubmit . "\n"; + echo '  ' . $strBookmarkView . "\n"; + echo '  ' . $strDelete . "\n"; + echo '
    ' . "\n"; } } ?> - -
  • -
  • -

  • - - 1) { - print "\n"; - print "\t\n"; - echo "\n"; - } + + 0) { ?> - - - - - - - - + +
  • + +
  • + + +
  • +
    +
    +
  • \n"; - print "\t\t + + - $i=0; - - while($i < $num_tables) { - $table = mysql_tablename($tables, $i); - echo "\t\t\t\n"; - $i++; - } - echo "\t\t\n"; - echo "\t
    - - - - - -
    - - - -
    + 1) { + echo "\n"; + ?> + + \n"; + $i = 0; + echo "\n"; + while ($i < $num_tables) { + $table = mysql_tablename($tables, $i); + echo ' ' . "\n"; + $i++; } ?> - - - - - -
    + ".$strGzip."\n"; - echo "
    - - - -
    - - - - -
  • -
    - - - -:
    -"; -// echo $strNumberIndexes.":"; -// echo ""; - echo "
    "; - echo $strFields.":"; - echo ""; - echo ""; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + onclick="if (!document.forms['db_dump'].elements['asfile'].checked) document.forms['db_dump'].elements['gzip'].checked = false" /> + + + () + + + + + + + + + + + + +
    +
  • + - -
  • -&zero_rows=&goto=main.php3&reload=true"> -
-
+ +
  • +
    + + + ' . "\n"; +echo ' ' . $strName . ' : ' . "\n"; +echo ' ' . '' . "\n"; +// echo ' ' . $strNumberIndexes. ' : ' . "\n"; +// echo ' ' . '' . "\n"; +echo ' ' . '
    ' . "\n"; +echo ' ' . $strFields . ' : ' . "\n"; +echo ' ' . '' . "\n"; +echo ' ' . ' ' . "\n"; ?> +
    +
  • + + +
  • + + +
  • + + + + + + \ No newline at end of file