dttnb997315 2014-08-28 12:56
浏览 197

mySQL SHOW TABLES - >表名不显示

I want to make a script search for the tables in my database.

I found that you can do that with a query "SHOW TABLES". After I implemented this and echoed the output on the browser, it doesn't show the table names as it should do. The number of tables is correct, but the output it shows is

ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray

12 times Array for I have 12 tables in my database.

Maybe it is in my code so here it is.

function backup_db()
  {
    require_once("../../Connections/chirodon_chirodb.php");

    // Find all tables in the Database
    $count = 0;

    $fetch_Tables = $chirodon_chirodb -> query("SHOW TABLES")  or die(mysql_error());

    while($table = $fetch_Tables -> fetch_array()) {
      $allTables[$count] = $table;
      $count++;
    }

    foreach($allTables as $table) {
      echo $table;
    }

    mysqli_free_result($fetch_Tables);
 }

$chirodon_chirodb is my connection to the database. This can't be the problem, because I've used it several time on my website without any issue.

  • 写回答

1条回答 默认 最新

  • doukuangxiu1621 2014-08-28 13:01
    关注

    Since you are fetching an array should it read as follows

    $allTables[$count] = $table[0];
    
    评论

报告相同问题?

悬赏问题

  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题