计算PHP中SQL表的数量?

计算PHP中SQL表的数量?,php,mysql,sql,Php,Mysql,Sql,我有一个包含许多表的数据库。我想知道如何使用PHP来计算数据库中表的总数?您可以使用sql语句来完成: select count(*) from information_schema.tables 从信息_schema.tables中选择COUNT*,其中table_schema='dbName' 你能行 SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'dbName'; 或 对schema.tables

我有一个包含许多表的数据库。我想知道如何使用PHP来计算数据库中表的总数?

您可以使用sql语句来完成:

select count(*) from information_schema.tables

从信息_schema.tables中选择COUNT*,其中table_schema='dbName'

你能行

SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'dbName';

对schema.tables中的信息进行查询

使用以下查询:

USE databasename; SHOW TABLES; SELECT FOUND_ROWS();
SELECT COUNT(*) FROM information_schema.TABLES
WHERE TABLE_SCHEMA='database_name';
SELECT COUNT(*) FROM information_schema.TABLES
WHERE TABLE_SCHEMA='database_name';