我想创建一个类似于phpmyadmin的网站,并创建一个下拉菜单,其中将显示数据库的名称,如果单击该菜单,则将从数据库中显示表名称,但是我不知道如何?
<?php
$set = mysqli_query($connect, 'SHOW DATABASES;');
$dbs = array();
while($db = mysqli_fetch_row($set)){
$dbs[1] = $db[0];
?>
<li>
<a href="#<?php echo implode ($dbs);?>" data-toggle="collapse" aria-expanded="false"><?php echo implode ($dbs);?></a>
<ul class="collapse list-unstyled" id="<?php echo implode ($dbs);?>">
<?php
//From Here..
$showtables= mysqli_query($connect, "SHOW TABLES FROM ".$tbname);
while($table = mysqli_fetch_array($showtables)) {
?>
<li><a href="#"><?php echo $table[0]; ?></a></li>
<?php
}
?>
</ul>
</li>
<?php
}
?>
</ul>