"Sharif T. Karim" wrote:
steve, being the foo steve is, wrote: "steve" wrote: > [quote:0f06a43aa5="Sharif T. Karim"]How would I get the
total size of > a mysql database in MB format?
> http://www.webmasterworld.com/forum88/2069.htm
Sorry, the above URL is password protected.
Here’s how to do it from php.
do a mysql "show table status"
which produces a number of columns including "data_lenght" and
"index_lenght". Simply add these two number and furthere add
them for all the return records (i.e. tables), and you get the db size.
Would I have to do a loop to get the total? Or just those array
variables
will have the total together?
[/quote:16866fe06a]
Sharif, each row of the result set would have two values that you
need: the index size, and the data size. Each row pertains to a
single table.
So you have to loop thru all the returned rows, and add these numbers
up to get the total size of the database.
Here is another page, just copy the code!
http://www.pro.hioxindia.com/tutorials/DBsize.php
--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL:
http://www.dbForumz.com/PHP-Database...ict131072.html
Visit Topic URL to contact author (reg. req'd). Report abuse:
http://www.dbForumz.com/eform.php?p=440087