doucheng9058 2017-02-21 09:12
浏览 58
已采纳

我想在codeigniter中显示我的数据库中的表

$this->db->query("show tables");    
$tables = $this->db->get();    
return $tables->result_array();

Error Number: 1096
No tables used
SELECT *

  • 写回答

2条回答 默认 最新

  • dpp10181 2017-02-21 09:15
    关注

    Use $this->db->list_tables() to get all the tables name from database.

    $tables = $this->db->list_tables();
    
    foreach ($tables as $table)
    {
            echo $table;
    }
    

    For more see docs Codeigniter Metadata

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?