Trying to convert my ugly mysql_ into PDO but I\'m having difficulty creating the equivalent.
$rows = mysql_query(\"SHOW TABLE STATUS\");
$dbSize = 0;
while ($
Older versions of PHP does not allow dereferencing returned arrays. See example 7 on this page. To fix, try this:
$sth = $conn->query('SHOW TABLE STATUS');
$dbSize = 0;
$row = $sth->fetch(PDO::FETCH_ASSOC);
$dbSize = $row["Data_length"];
$decimals = 2;
$mbytes = round($dbSize/(1024*1024),$decimals);
echo "$dbSize";