query('SHOW TABLES'); $Tables =$DB->collect('Tables_in_'.SQLDB); if (!in_array($_GET['table'], $Tables)) { error(0); } $DB->query('SHOW CREATE TABLE '.db_string($_GET['table'])); list(,$Schema) = $DB->next_record(MYSQLI_NUM, false); header('Content-type: text/plain'); die($Schema); } //Cache the tables for 4 hours, makes sorting faster if (!$Tables = $Cache->get_value('database_table_stats')) { $DB->query('SHOW TABLE STATUS'); $Tables =$DB->to_array(); $Cache->cache_value('database_table_stats',$Tables,3600*4); } require(SERVER_ROOT.'/classes/class_charts.php'); $Pie = new PIE_CHART(750,400,array('Other'=>1,'Percentage'=>1,'Sort'=>1)); //Begin sorting $Sort = array(); switch (empty($_GET['order_by'])?'':$_GET['order_by']) { case 'name': foreach ($Tables as $Key => $Value) { $Pie->add($Value[0], $Value[6] + $Value[8]); $Sort[$Key] = $Value[0]; } break; case 'engine': foreach ($Tables as $Key => $Value) { $Pie->add($Value[0], $Value[6] + $Value[8]); $Sort[$Key] = $Value[1]; } break; case 'rows': foreach ($Tables as $Key => $Value) { $Pie->add($Value[0], $Value[4]); $Sort[$Key] = $Value[4]; } break; case 'rowsize': foreach ($Tables as $Key => $Value) { $Pie->add($Value[0], $Value[5]); $Sort[$Key] = $Value[5]; } break; case 'datasize': foreach ($Tables as $Key => $Value) { $Pie->add($Value[0], $Value[6]); $Sort[$Key] = $Value[6]; } break; case 'indexsize': foreach ($Tables as $Key => $Value) { $Pie->add($Value[0], $Value[8]); $Sort[$Key] = $Value[8]; } break; case 'totalsize': default: foreach ($Tables as $Key => $Value) { $Pie->add($Value[0], $Value[6] + $Value[8]); $Sort[$Key] = $Value[6] + $Value[8]; } } $Pie->generate(); if (!empty ($_GET['order_way']) && $_GET['order_way'] == 'asc') { $SortWay = SORT_ASC; } else { $SortWay = SORT_DESC; } array_multisort($Sort, $SortWay, $Tables); //End sorting View::show_header('Database Specifics'); ?>

Breakdown


Name Engine Rows Row Size Data Size Index Size Total Size Tools
Schema