如何让这段代码在Codeigniter上工作的回声总mysql数据库表大小?
SELECT table_schema "Data Base Name",
sum( data_length + index_length ) / 1024 /
1024 "Data Base Size in MB",
sum( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
GROUP BY table_schema;
这是如何回显总mysql数据库表行数:
<?php
$sqlx = $this->db->list_tables();
$finalCount = 0;
foreach ($sqlx as $table) {
$counteachrow = $this->db->count_all_results($table);
$finalCount += $counteachrow;
}
?>
<?php echo $finalCount; ?>
2条答案
按热度按时间wmtdaxz31#
创建新模型
以及控制器
oiopk7p52#