我在php中执行此代码,同时选择任何数据库,它只显示表的数量而不是所选数据库的所有表的名称

<?php
    session_start();`enter code here`
    include 'dbconnect.php';

    $q=$_GET['q'];

    echo $field= "Tables_in_".$q;

    $sql = "SHOW TABLES FROM $q";

    $result= mysqli_query($conn,$sql);

     $new= array();
     $i=0;

    while ($row=mysqli_fetch_row($result)){
        echo $row['Tables_in_mysql'];

        $new[$i]=$row;
        $i++;
    }
    echo $num=count($new);
?>

<?php
    for($j=0;$j<$num;$j++){
        echo "here"; 
?>   

<?php echo $new[$j]['mysql']; ?>

<?php } ?>
<?php echo $q;?>

<?php
    session_start();`enter code here`
    include 'dbconnect.php';

    $q=$_GET['q'];

    echo $field= "Tables_in_".$q;

    $sql = "SHOW TABLES FROM $q";

    $result= mysqli_query($conn,$sql);

     $new= array();
     $i=0;

     while ($row=mysqli_fetch_row($result)){

        echo $row['Tables_in_mysql'];

        $new[$i]=$row;
        $i++;

    }
    echo $num=count($new);

?>

<?php for($j=0;$j<$num;$j++){      

    echo "here"; 
?>   


<?php echo $new[$j]['mysql'];   ?>

<?php } ?>
<?php echo $q;?>

This is my code please help me in printing all the names of the tables of the selected database in php I have shown all the names of the database by show database command and it is displaying in a dropdown and while selecting particular database it only displays the number of the tables in it but i want to display names of tables

As you did not post any code this answer is perhaps not what you were after... but this will display all the tables in the current database.

select `table_name` as 'table' 
    from `information_schema`.`tables` 
    where `table_type`='base table' and `table_schema`=database();