Re: Setting total db size to a variable.
| From: | David Nicholson | Date: | Sun, 20 Jul 2003 00:51:04 +0000 |
| Subject: | Re: Setting total db size to a variable. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155926@lists.php.net to get a copy of this message | ||
Hello,
This is a reply to an e-mail that you wrote on Sun, 20 Jul 2003 at
00:42, lines prefixed by '>' were originally written by you.
> I have a question in regards to finding the total db size and
setting
> it to a variable.
> How would I go about this?
For mysql this will do the trick...
$info = mysql_fetch_array(mysql_query("show table status from
$databasename = '$tablename'"));
$sizeinMB = $info["Data_length"]/1024/1024;
--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
http://www.quizsender.com/
(developed entirely in PHP)