method dbSize documentation in bbn\Db\Languages\Mysql
Gets the size of a database
function(string $database = '', string $type = '')
{
$cur = null;
if ($database && ($this->getCurrent() !== $database)) {
$cur = $this->getCurrent();
$this->change($database);
}
$q = $this->query('SHOW TABLE STATUS');
$size = 0;
while ($row = $q->getRow()) {
if (!$type || ($type === 'data')) {
$size += $row['Data_length'];
}
if (!$type || ($type === 'index')) {
$size += $row['Index_length'];
}
}
if ($cur !== null) {
$this->change($cur);
}
return $size;
}
Gets the size of a database BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions