title: PHP PDO How does rowCount() get it's results?
body: <p>Does PHP's PDO run a silent <code>select count(*)</code> statement for it's <code>rowCount()</code> when used after a <code>select</code> statement, or does it get it's result using some other approach?</p>
  
  <pre><code>$query = $conn-&gt;prepare('select name, alias from accounts where status = 0');
  
  $query-&gt;execute();
  
  $queryCount = $query-&gt;rowCount();
  
  $profiles = $query-&gt;fetchAll(PDO::FETCH_ASSOC);
  
  if($queryCount &gt; 0) {
      print_r($profiles);
  } else {
      echo 'No records found';
  }
  </code></pre>
  
  <p>In the above code, everything runs fine, and I'm able to get the correct number of rows as the result. But is there a <code>count</code> statement running in there? How does PHP do this?</p>