数码资讯
PHP中每个表中数据量的快速统计
所以我只是写了几行代码来达到上述要求。 实施结果: 复制代码代码如下所示: < PHP 美元mysql_connect conn =('localhost ','root ','); mysql_select_db('database,$ Conn); 为SQL = 选择information_sc
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
所以我只是写了几行代码来达到上述要求。
实施结果:
复制代码代码如下所示:
< PHP
美元mysql_connect conn =('localhost ','root ',');
mysql_select_db('database,$ Conn);
为SQL = 选择information_schema.tables.table_name从information_schema。表table_schema = '数据库';
RES = mysql_query美元($ SQL);
而($结果= mysql_fetch_assoc($ RES)){
为表{ } = { } 'table_name美元的结果;
};
回声
表名
数据量
;
foreach($表$ K = > $ V){
sql_count美元=select count(ID)为号,,从五美元。美元$ K表{ };
res_count = mysql_query美元(美元sql_count);
result_count = mysql_fetch_assoc美元(美元res_count);
回声。result_count美元{ $ V }。result_count { }美元'nums'。;
}
>
实施结果:
复制代码代码如下所示:
< PHP
美元mysql_connect conn =('localhost ','root ',');
mysql_select_db('database,$ Conn);
为SQL = 选择information_schema.tables.table_name从information_schema。表table_schema = '数据库';
RES = mysql_query美元($ SQL);
而($结果= mysql_fetch_assoc($ RES)){
为表{ } = { } 'table_name美元的结果;
};
回声
表名
数据量
;
foreach($表$ K = > $ V){
sql_count美元=select count(ID)为号,,从五美元。美元$ K表{ };
res_count = mysql_query美元(美元sql_count);
result_count = mysql_fetch_assoc美元(美元res_count);
回声。result_count美元{ $ V }。result_count { }美元'nums'。;
}
>
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。