-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb-index.php
45 lines (29 loc) · 1.18 KB
/
db-index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
//* Tämä skripti käyttää slave-tietokantapalvelinta *//
$useslave = 1;
require "inc/parametrit.inc";
echo "<table><tr><td valign='top' class='back'>";
$query = "SHOW FULL TABLES FROM `$dbkanta` WHERE Table_Type = 'BASE TABLE'";
$result = pupe_query($query);
while ($row=mysqli_fetch_array($result)) {
echo "<a href='$PHP_SELF?table=$row[0]'>$row[0]</a><br>";
}
echo "</td><td class='back' valign='top'>";
if ($table!='') {
$query = "show index from $table";
$fields = pupe_query($query);
echo "<b>$table</b> (<a href='db.php?table=$table'>table</a> - <a href='db-index.php?table=$table'>index</a>)<br><br>";
echo "<table>";
echo "<tr><th>Key_name</th><th>Seq_in_index</th><th>Column_name</th><th>Cardinality</th><th>Index_type</th></tr>";
$boob = 1;
while ($row=mysqli_fetch_array($fields)) {
if ($row['Seq_in_index']==1 and $boob==0) {
echo "<tr><td class='back' colspan='5'><hr noshade></td></tr>";
}
echo "<tr><td>$row[Key_name]</td><td>$row[Seq_in_index]</td><td>$row[Column_name]</td><td>$row[Cardinality]</td><td>$row[Index_type]</td></tr>";
$boob = 0;
}
echo "</table>";
}
echo "</td></tr></table>";
require "inc/footer.inc";