加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

读取mysql一个库下面的所有的表table

发布时间:2020-12-12 08:15:54 所属栏目:MsSql教程 来源:网络整理
导读:我们先来看代码: phprequire '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

我们先来看代码:

<?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) “”

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读