<?php
function formatfilesize($data) {
if ($data < 1024) {
return $data . " bytes";
} else if ($data < 1024000) {
return round(( $data / 1024), 1) . " KB";
} else {
return round(( $data / 1024000), 1) . " MB";
}
}
$db = mysql_connect("localhost", "lovsim", "12345xarakters");
mysql_select_db("lovsim", $db);
$result = mysql_query("SHOW TABLE STATUS");
$dbsize = 0;
while ($row = mysql_fetch_array($result)) {
$dbsize += $row["Data_length"] + $row["Index_length"];
}
?>