list all tables in a database with MySQLi

后端 未结 4 1808
梦谈多话
梦谈多话 2021-02-14 04:13

I have looked around and still can\'t find how to list all my tables in a database. is it possible with MySQLi?

Thanks.

4条回答
  •  青春惊慌失措
    2021-02-14 05:06

    There are many ways.

    SHOW TABLES
    

    Is the most simple SQL statement for doing that. You can also take a look at INFORMATION_SCHEMA.TABLES if you want to have more details or do some filtering or such.

    SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA LIKE 'your_database';
    

提交回复
热议问题