Return to Snippet

Revision: 649
at July 25, 2006 00:35 by mate


Initial Code
<?php
    $dbname = "databasename";
    mysql_select_db( $dbname );
    $result = mysql_query( "SHOW TABLE STATUS" );
    $dbsize = 0;
	
    while( $row = mysql_fetch_array( $result ) ) {  
	
        $dbsize += $row[ "Data_length" ] + $row[ "Index_length" ];
		
    }
    echo "<p>The size of the database is " . formatfilesize( $dbsize ) . "</p>";

?>

Initial URL
http://www.goodphptutorials.com/track/163

Initial Description
Extraido de Good PHP Tutorials, un articulo de Tim Bennett

Initial Title
Calcular tamaño BBDD en MySQL

Initial Tags
mysql

Initial Language
PHP