show table comment/description as tooltip in left frame

This commit is contained in:
Korakot Chaovavanich
2001-10-04 02:29:52 +00:00
parent 0352e26eef
commit 2b2c88b620
2 changed files with 22 additions and 3 deletions

View File

@@ -105,6 +105,7 @@ $cfgConfirm = TRUE; // confirm 'DROP TABLE' & 'DROP DATABASE'
$cfgShowStats = TRUE; // allow to display statistics and space usage in
// the pages about database details and table
// properties
$cfgShowTooltip = TRUE; // display table comment as tooltip in left frame
$cfgShowBlob = FALSE; // display blob field contents in browse mode
$cfgShowAll = FALSE; // allows to display all the rows in browse mode

View File

@@ -176,6 +176,15 @@ if ($num_dbs > 1) {
$num_tables_disp = '-';
}
// Get additional infomation about tables for tooltip
if ($cfgShowTooltip && MYSQL_INT_VERSION >= 32303) {
$tooltip = array();
$result = mysql_query("SHOW TABLE STATUS FROM $db");
while ($tmp = mysql_fetch_array($result)) {
$tooltip[$tmp['Name']] = $tmp['Comment'] . ' (' . $tmp['Rows'] . ' rows)';
}
}
// Displays the database name
echo "\n";
echo ' <div id="el' . $j . 'Parent" class="parent">';
@@ -209,7 +218,7 @@ if ($num_dbs > 1) {
<nobr><img src="images/spacer.gif" border="0" width="9" height="9" alt="" />
<a target="phpmain" href="sql.php3?<?php echo $common_url_query; ?>&table=<?php echo urlencode($table); ?>&sql_query=<?php echo urlencode('SELECT * FROM ' . backquote($table)); ?>&pos=0&goto=tbl_properties.php3">
<img src="images/browse.gif" border="0" alt="<?php echo "$strBrowse: $table"; ?>" /></a>&nbsp;
<a class="tblItem" target="phpmain" href="tbl_properties.php3?<?php echo $common_url_query; ?>&table=<?php echo urlencode($table); ?>">
<a class="tblItem" title="<?php echo addslashes($tooltip[$table]);?>" target="phpmain" href="tbl_properties.php3?<?php echo $common_url_query; ?>&table=<?php echo urlencode($table); ?>">
<?php echo $table; ?></a></nobr><br />
<?php
} // end for $j (tables list)
@@ -250,7 +259,16 @@ else if ($num_dbs == 1) {
} else {
$num_tables_disp = '-';
}
// Get additional infomation about tables for tooltip
if ($cfgShowTooltip && MYSQL_INT_VERSION >= 32303) {
$tooltip = array();
$result = mysql_query("SHOW TABLE STATUS FROM $db");
while ($tmp = mysql_fetch_array($result)) {
$tooltip[$tmp['Name']] = $tmp['Comment'] . ' (' . $tmp['Rows'] . ' rows)';
}
}
// Displays the database name
echo "\n";
?>
@@ -267,7 +285,7 @@ else if ($num_dbs == 1) {
?>
<nobr><a target="phpmain" href="sql.php3?<?php echo $common_url_query; ?>&table=<?php echo urlencode($table); ?>&sql_query=<?php echo urlencode('SELECT * FROM ' . backquote($table)); ?>&pos=0&goto=tbl_properties.php3">
<img src="images/browse.gif" border="0" alt="<?php echo "$strBrowse: $table"; ?>" /></a>&nbsp;
<a class="tblItem" target="phpmain" href="tbl_properties.php3?<?php echo $common_url_query; ?>&table=<?php echo urlencode($table); ?>">
<a class="tblItem" title="<?php echo addslashes($tooltip[$table]);?>" target="phpmain" href="tbl_properties.php3?<?php echo $common_url_query; ?>&table=<?php echo urlencode($table); ?>">
<?php echo $table; ?></a></nobr><br />
<?php
} // end for $j (tables list)