title: PDO fetch returns only first row
body: <p>I'm using the following code to make a connection to the database, fetch the <code>Data_length</code> index column, and calculate the database size based on the data.</p>
  <p>For some reason PDO will always return &quot;0&quot;, which is the value for the <code>Data_length</code> index in the first row. Whatever I do, I only get the first rows index.</p>
  <p>The database is MySQL, the engine MyISAM.</p>
  <p>PHP Version: 5.5.38<br />
  MySQL Version: 5.5.50</p>
  <p>Here is the source code.</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;head&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;?php
  try {
      error_reporting(-1);
      $host_name  = &quot;my_host&quot;;
      $database   = &quot;my_db&quot;;
      $user_name  = &quot;my_user&quot;;
      $password   = &quot;my_pwd&quot;;
      $conn = new PDO(&quot;mysql:host=$host_name;dbname=$database&quot;, $user_name, $password);
      $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  
      $sth = $conn-&gt;query('SHOW TABLE STATUS');
      $dbSize = 0;
      $row = $sth-&gt;fetch(PDO::FETCH_ASSOC);
      $dbSize = $row[&quot;Data_length&quot;];
      $decimals = 2;  
      $mbytes = round($dbSize/(1024*1024),$decimals);
      echo $dbSize . &quot;\n&quot; . $row[&quot;Data_length&quot;];
      } catch (PDOException $e) {
      echo 'Connection failed: ' . $e-&gt;getMessage();
  }
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>