I'd like to share a little code with anyone interested in showing the size of their MySQL database on the admin page Tools->Server Information.
This will show the size used in MB, to the right of the Database version.
Just two small edits are required to /admin/server_info.php
1. About line 14 paste the following
2. Then find the following (at about line 110)Code://BillyWizz 2007-07-17 Get Database Size - START $dbsize_details = $db->Execute("SHOW TABLE STATUS"); $dbsize = 0; while (!$dbsize_details->EOF) { $dbsize += $dbsize_details->fields['Data_length'] + $dbsize_details->fields['Index_length']; $dbsize_details->MoveNext(); } if ($dbsize != 0) {$dbsize = number_format($dbsize/1000000,1);} //BillyWizz 2007-07-17 Get Database Size - END
.. and replace it withCode:<?php echo $system['db_version']; ?>
Hope this is useful in avoiding the wrath of your host.Code:<?php echo $system['db_version'] . ' (' . $dbsize . 'MB)'; //BillyWizz 2007-07-17 Get Database Size - REPLACED ?>
Tested ok on Zen Cart version 1.3.7
Script server_info.php 4279 2006-08-26 03:31:29Z drbyte $
BW



