Hjælp til addition af SHOW SQL STATUS
Hej.. Jeg har disse 2 arrays.DB størrelse 2852 Bytes ud af 1.024.000 Bytes
Array
(
[0] => branche
[Name] => branche
[1] => MyISAM
[Engine] => MyISAM
[2] => 9
[Version] => 9
[3] => Dynamic
[Row_format] => Dynamic
[4] => 20
[Rows] => 20
[5] => 40
[Avg_row_length] => 40
[6] => 804
[Data_length] => 804
[7] => 4294967295
[Max_data_length] => 4294967295
[8] => 2048
[Index_length] => 2048
[9] => 0
[Data_free] => 0
[10] => 63
[Auto_increment] => 63
[11] => 2007-06-13 21:22:51
[Create_time] => 2007-06-13 21:22:51
[12] => 2007-09-03 15:34:32
[Update_time] => 2007-09-03 15:34:32
[13] =>
[Check_time] =>
[14] => latin1_swedish_ci
[Collation] => latin1_swedish_ci
[15] =>
[Checksum] =>
[16] =>
[Create_options] =>
[17] =>
[Comment] =>
)
DB størrelse 2560 Bytes ud af 1.024.000 BytesArray
(
[0] => counter
[Name] => counter
[1] => MyISAM
[Engine] => MyISAM
[2] => 9
[Version] => 9
[3] => Dynamic
[Row_format] => Dynamic
[4] => 16
[Rows] => 16
[5] => 32
[Avg_row_length] => 32
[6] => 512
[Data_length] => 512
[7] => 4294967295
[Max_data_length] => 4294967295
[8] => 2048
[Index_length] => 2048
[9] => 0
[Data_free] => 0
[10] => 17
[Auto_increment] => 17
[11] => 2007-05-24 14:00:49
[Create_time] => 2007-05-24 14:00:49
[12] => 2007-06-19 22:44:27
[Update_time] => 2007-06-19 22:44:27
[13] =>
[Check_time] =>
[14] => latin1_swedish_ci
[Collation] => latin1_swedish_ci
[15] =>
[Checksum] =>
[16] =>
[Create_options] =>
[17] =>
[Comment] =>
)
Hvordan lægges de sammen, så jeg får resultatet af data.lenght og index.lenght?
Koden:
$result = mysql_query("SHOW TABLE STATUS");
while ($row = mysql_fetch_array($result))
{
$total = $row['Data_length'] + $row['Index_length'];
$size = ($row[6] + $row[8]);
echo "<br/>";
echo "<span class=\"bottomtext\">DB størrelse </span>";
echo "<span class=\"bottomtext\">$total</span>";
echo "<span class=\"bottomtext\"> Bytes ud af 1.024.000 Bytes</span>";
echo "<pre>";
print_r($row);
echo "</br>";