讀取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 表記錄數(shù)量
DATA_LENGTH 數(shù)據(jù)長度。
["TABLE_CATALOG"]=>
NULL
["TABLE_SCHEMA"]=>
string(10) “l(fā)eo_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”出現(xiàn)錯誤解決辦法
- 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錯誤解決方法
- 出現(xiàn)錯誤mysql Table ''performance_schema...解決辦法
相關(guān)文章
MySQL出現(xiàn)"Lock?wait?timeout?exceeded"錯誤的原因是什么詳解
這篇文章主要給大家介紹了關(guān)于MySQL出現(xiàn)"Lock?wait?timeout?exceeded"錯誤的原因是什么的相關(guān)資料,工作中同事遇到此異常,查找解決問題時,收集整理形成此篇文章,文中通過實例代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-05-05
MySQL5.7的sql腳本導(dǎo)入到MySQL5.5出錯3種解決方案
筆者需要將使用MySQL5.7數(shù)據(jù)庫的網(wǎng)站挪入winows服務(wù)器,目標(biāo)服務(wù)器使用的是MySQL5.5,因為兼顧到以前的網(wǎng)站,MySQL不能升級。遇到MySQL5.7的sql腳本導(dǎo)入到MySQL5.5出錯,總結(jié)了3種解決方案,總有一個方案適合你。2023-06-06
自動恢復(fù)MySQL數(shù)據(jù)庫的日志文件思路分享及解決方案
本文主要講訴如何自動恢復(fù)mysql數(shù)據(jù)庫的日志文件,喜歡的在服務(wù)器或者數(shù)據(jù)庫上直接操作的兄弟們你值得收藏下!2014-08-08
Centos8安裝mysql8的詳細(xì)過程(免安裝版/或者二進(jìn)制包方式安裝)
這篇文章主要介紹了Centos8安裝mysql8的詳細(xì)過程(免安裝版/或者二進(jìn)制包方式安裝),使用二進(jìn)制包方式安裝首先檢查服務(wù)器上是否安裝有mysql然后開始安裝配置,本文分步驟給大家講解的非常詳細(xì),需要的朋友可以參考下2022-11-11

