| <?php |
| |
| require_once "/home/data/httpd/eclipse-php-classes/system/dbconnection_foundation_ro.class.php"; |
| |
| ?> |
| |
| <br /> |
| <td width="100%" valign="top" class="normal"> |
| <font class="large_title">Bugzilla database schema</font><br /><br /> |
| </td> |
| |
| <?php |
| $dbc = new DBConnectionFoundation(); |
| $dbh = $dbc->connect(); |
| |
| $sql = "SHOW TABLES"; |
| $rs = mysql_query($sql, $dbh); |
| echo mysql_error($dbh); |
| |
| |
| while($myrow = mysql_fetch_assoc($rs)){ |
| $TableName = $myrow['Tables_in_eclipsefoundation']; |
| $sql = "DESCRIBE " . $TableName; |
| $rs2 = mysql_query($sql, $dbh); |
| echo mysql_error($dbh); |
| |
| |
| $sql = "SELECT COUNT(*) AS RecordCount FROM " . $TableName; |
| $rs3 = mysql_query($sql, $dbh); |
| echo mysql_error($dbh); |
| |
| $myrow3 = mysql_fetch_assoc($rs3); |
| |
| if($myrow3['RecordCount'] > 0) { |
| |
| ?> |
| <table border="1"> |
| <tr><td colspan="6"><b>Table: <?= $TableName ?> </b></td></tr> |
| <tr> |
| <td>Field </td> |
| <td>Type </td> |
| <td>Null </td> |
| <td>Key </td> |
| <td>Default </td> |
| <td>Extra </td> |
| </tr> |
| <?php |
| |
| |
| while($myrow2 = mysql_fetch_assoc($rs2)) { |
| ?> |
| <tr> |
| <td><?= $myrow2['Field'] ?> </td> |
| <td><?= $myrow2['Type'] ?> </td> |
| <td><?= $myrow2['Null'] ?> </td> |
| <td><?= $myrow2['Key'] ?> </td> |
| <td><?= $myrow2['Default'] ?> </td> |
| <td><?= $myrow2['Extra'] ?> </td> |
| </tr> |
| <?php |
| } |
| |
| echo "<tr><td colspan=\"6\">" . number_format($myrow3['RecordCount'], 0, '', ',') . " row(s)</td></tr></table><br />"; |
| } |
| } |
| |
| |
| $dbc->disconnect(); |
| |
| $rs = null; |
| $rs2 = null; |
| $rs3 = null; |
| $dbh = null; |
| $dbc = null; |
| |
| ?> |