I\'m using the following code to make a connection to the database, fetch the Data_length index column, and calculate the database size based on the data.
Data_length
Add a while loop,
while($row= $sth->fetch( PDO::FETCH_ASSOC )){ echo $row['your_field_name']; }
Or you can use fetchAll
fetchAll
$rows = $sth->fetchAll(); print_r($rows);