Forum Moderators: coopster
that code above is how to get the amount of Kb of a certain table in your db
this code below calculates total amount (=filesize) of a certain database
problem for me here:
how to use round in the expression below (as in the example given above)
$total = $row['Data_length']+$row['Index_length'];
float round ( float val [, int precision])
and you have
$total = $row['Data_length']+$row['Index_length'];
if you want to round the value after the addition then this would work, I set the precision to 2
$total = round($row['Data_length']+$row['Index_length'],2);
or if you wanted to round each one before the addition, again each precision 2
$total = round($row['Data_length'],2)+round($row['Index_length'],2);
float round ( float val [, int precision])
precision is the second parameter for the function
Returns the rounded value of val to specified precision (number of digits after the decimal point). precision can also be negative or zero (default).