6 * Gets the variables sent or posted to this script, then displays headers
8 require('./grab_globals.inc.php3');
9 if (!isset($message)) {
10 include('./header.inc.php3');
12 show_message($message);
18 * Selects the database
24 * Displays the comments of the table is MySQL >= 3.23
26 if (MYSQL_MAJOR_VERSION
>= 3.23) {
27 $result = mysql_query('SHOW TABLE STATUS LIKE \'' . sql_addslashes($table, TRUE) . '\'') or mysql_die();
28 $row = mysql_fetch_array($result);
29 if (!empty($row['Comment'])) {
30 echo $strTableComments . ' : ' . $row['Comment'];
32 } // end display comments
36 * Displays the table structure
38 // Gets fields properties
39 $result = mysql_query('SHOW FIELDS FROM ' . backquote($table)) or mysql_die();
42 <!-- TABLE INFORMATIONS
-->
43 <table border
="<?php echo $cfgBorder; ?>">
45 <th
><?php
echo ucfirst($strField); ?
></th
>
46 <th
><?php
echo ucfirst($strType); ?
></th
>
47 <th
><?php
echo ucfirst($strAttr); ?
></th
>
48 <th
><?php
echo ucfirst($strNull); ?
></th
>
49 <th
><?php
echo ucfirst($strDefault); ?
></th
>
50 <th
><?php
echo ucfirst($strExtra); ?
></th
>
55 while ($row = mysql_fetch_array($result)) {
56 $bgcolor = ($i %
2) ?
$cfgBgcolorOne : $cfgBgcolorTwo;
60 // reformat mysql query output - staybyte - 9. June 2001
61 $shorttype = substr($type, 0, 3);
62 if ($shorttype == 'set' ||
$shorttype == 'enu') {
63 $type = eregi_replace(',', ', ', $type);
66 $type_nowrap = ' nowrap="nowrap"';
68 $type = eregi_replace('BINARY', '', $type);
69 $type = eregi_replace('ZEROFILL', '', $type);
70 $type = eregi_replace('UNSIGNED', '', $type);
75 $binary = eregi('BINARY', $row['Type'], $test);
76 $unsigned = eregi('UNSIGNED', $row['Type'], $test);
77 $zerofill = eregi('ZEROFILL', $row['Type'], $test);
78 $strAttribute = ' ';
80 $strAttribute = 'BINARY';
83 $strAttribute = 'UNSIGNED';
86 $strAttribute = 'UNSIGNED ZEROFILL';
90 <tr bgcolor
="<?php echo $bgcolor; ?>">
91 <td nowrap
="nowrap"><?php
echo htmlspecialchars($row['Field']); ?
> 
;</td
>
92 <td
<?php
echo $type_nowrap; ?
>><?php
echo $type; ?
></td
>
93 <td nowrap
="nowrap"><?php
echo $strAttribute; ?
></td
>
94 <td
><?php
echo (($row['Null'] == '') ?
$strNo : $strYes); ?
> 
;</td
>
95 <td nowrap
="nowrap"><?php
if (isset($row['Default'])) echo htmlspecialchars($row['Default']); ?
> 
;</td
>
96 <td nowrap
="nowrap"><?php
echo $row['Extra']; ?
> 
;</td
>
109 $result = mysql_query('SHOW KEYS FROM ' . backquote($table)) or mysql_die();
110 if (mysql_num_rows($result) > 0) {
115 <?php
echo $strIndexes . ' :' . "\n"; ?
>
116 <table border
="<?php echo $cfgBorder; ?>">
118 <th
><?php
echo $strKeyname; ?
></th
>
119 <th
><?php
echo $strUnique; ?
></th
>
120 <th
><?php
echo $strField; ?
></th
>
123 for ($i = 0 ; $i < mysql_num_rows($result); $i++
) {
124 $row = mysql_fetch_array($result);
128 <td
><?php
echo htmlspecialchars($row['Key_name']) . "\n"; ?
></td
>
129 <td
><?php
echo (($row['Non_unique'] == '0') ?
$strYes : $strNo) . "\n"; ?
></td
>
130 <td
><?php
echo htmlspecialchars($row['Column_name']) . "\n"; ?
></td
>
142 * Displays the footer
145 require('./footer.inc.php3');