Файл: system/core/core/formatfilesize.php
Строк: 16
<?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","user","pass"); ~~~~~~~//
//~~~~~~~~~~~~~~~~mysql_select_db("dbname",$db); ~~~~~~~~~~~~~~~~~~~~~~~~//
$db = mysql_connect ("localhost","lovs","lovs");
mysql_select_db("lovs",$db);
$result = mysql_query( "SHOW TABLE STATUS" );
$dbsize = 0;
while( $row = mysql_fetch_array( $result ) ) {
$dbsize += $row[ "Data_length" ] + $row[ "Index_length" ];
}
?>