读取mysql一个库下面的所有的表table
我们先来看代码:
<?php
require 'class/db.php';
$sql = "select * from information_schema.tables where table_schema='ecshop' and table_type='base table' order by TABLE_ROWS desc ";
$arr = $db->queryArray($sql);
//var_dump($arr);
foreach ($arr as $k => $v) {
$tbname = $v->TABLE_NAME;
$rows = $v->TABLE_ROWS;
echo $tbname.' - ';
echo $rows;
echo '<br>';
}
?>
TABLE_NAME 表名字
TABLE_ROWS 表记录数量
DATA_LENGTH 数据长度。
["TABLE_CATALOG"]=>
NULL
["TABLE_SCHEMA"]=>
string(10) “leo_ecshop”
["TABLE_NAME"]=>
string(9) “ecs_goods”
["TABLE_TYPE"]=>
string(10) “BASE TABLE”
["ENGINE"]=>
string(6) “MyISAM”
["VERSION"]=>
string(2) “10″
["ROW_FORMAT"]=>
string(7) “Dynamic”
["TABLE_ROWS"]=>
string(1) “7″
["AVG_ROW_LENGTH"]=>
string(3) “286″
["DATA_LENGTH"]=>
string(4) “2008″
["MAX_DATA_LENGTH"]=>
string(15) “281474976710655″
["INDEX_LENGTH"]=>
string(5) “11264″
["DATA_FREE"]=>
string(1) “0″
["AUTO_INCREMENT"]=>
string(1) “8″
["CREATE_TIME"]=>
string(19) “2016-11-15 22:27:40″
["UPDATE_TIME"]=>
string(19) “2016-12-04 11:25:55″
["CHECK_TIME"]=>
string(19) “2016-12-04 11:19:50″
["TABLE_COLLATION"]=>
string(15) “utf8_general_ci”
["CHECKSUM"]=>
NULL
["CREATE_OPTIONS"]=>
string(0) “”
["TABLE_COMMENT"]=>
string(0) “”
- mysql中错误:1093-You can’t specify target table for update in FROM clause的解决方法
- mysql “ Every derived table must have its own alias”出现错误解决办法
- MySQL无法重启报错Warning: World-writable config file ‘/etc/my.cnf’ is ignored的解决方法
- mysql Event Scheduler: Failed to open table mysql.event
- mysql中You can’t specify target table for update in FROM clause错误解决方法
- 出现错误mysql Table ''performance_schema...解决办法
相关文章
MySQL出现"Lock wait timeout exceeded"错误的原因是什么详解
这篇文章主要给大家介绍了关于MySQL出现"Lock wait timeout exceeded"错误的原因是什么的相关资料,工作中同事遇到此异常,查找解决问题时,收集整理形成此篇文章,文中通过实例代码介绍的非常详细,需要的朋友可以参考下2023-05-05
MySQL5.7的sql脚本导入到MySQL5.5出错3种解决方案
笔者需要将使用MySQL5.7数据库的网站挪入winows服务器,目标服务器使用的是MySQL5.5,因为兼顾到以前的网站,MySQL不能升级。遇到MySQL5.7的sql脚本导入到MySQL5.5出错,总结了3种解决方案,总有一个方案适合你。2023-06-06
Centos8安装mysql8的详细过程(免安装版/或者二进制包方式安装)
这篇文章主要介绍了Centos8安装mysql8的详细过程(免安装版/或者二进制包方式安装),使用二进制包方式安装首先检查服务器上是否安装有mysql然后开始安装配置,本文分步骤给大家讲解的非常详细,需要的朋友可以参考下2022-11-11


最新评论