Read all tables in a mysql database and mysqltable

Source: Internet
Author: User

Read all tables in a mysql database and mysqltable

Let's first look at the Code:

<?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 $k => $v) { $tbname = $v->TABLE_NAME; $rows = $v->TABLE_ROWS; echo $tbname.' - '; echo $rows; echo '<br>';}?>

TABLE_NAME table name

Number of TABLE_ROWS table records

The length of DATA_LENGTH data.

["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) "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) ""

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.