title: How to check if a row exist in the database using PDO?
body: <p>I want to have a condition that will perform some action when the row doesn't exist at all.</p>
  <pre><code>$stmt = $conn-&gt;prepare('SELECT * FROM table WHERE ID=?');
  $stmt-&gt;bindParam(1, $_GET['id'], PDO::PARAM_INT);
  $stmt-&gt;execute();
  $row = $stmt-&gt;fetch(PDO::FETCH_ASSOC);
  </code></pre>
  <p>Tried <code>if (count($row) == 0)</code> and <code>if($stmt-&gt;rowCount() &lt; 0)</code> but none of them works.</p>