hey hi guys i have this problem... i want to return my db space but i dont know how to do it, this is my code:
function chSett(){
function file_size_info($filesize) {
$bytes = array('KB', 'KB', 'MB', 'GB', 'TB'); # values are always displayed
if ($filesize < 1024) $filesize = 1; # in at least kilobytes.
for ($i = 0; $filesize > 1024; $i++) $filesize /= 1024;
$file_size_info['size'] = ceil($filesize);
$file_size_info['type'] = $bytes[$i];
return $file_size_info;
}
$rows = mysql_query("SHOW TABLE STATUS");
$dbsize = 0;
while ($row = mysql_fetch_array($rows)) {
$dbsize += $row['Data_length'] + $row['Index_length'];
}
$dbsize = file_size_info($dbsize);
$andy="el mejor";
$myquery= mysql_query("select ttpp.tPeriods, enesettings.tPeriod, enesettings.tempo, enesettings.tempow, enesettings.disponible from enesettings join ttpp");
return "$myquery {$dbsize['size']} {$dbsize['type']}";
}
but it outputs something like: Result: "Resource id #20 52 KB"