title: Alternative for mysql_num_rows using PDO
body: <p>Right now I have a PHP file that does a MYSQL query and then counts rows like this:</p>
  
  <pre><code>$count=mysql_num_rows($result);
  
  
  if ($count == 1) {
      $message = array('status' =&gt; 'ok');
  } else {
      $message = array('status' =&gt; 'error');
  }
  </code></pre>
  
  <p>This works fine but I'm trying to change all my PHP files to use PDO. So how can this be done with PDO?</p>