title: Value return when no rows in PDO
body: <p>I have a PDO function:</p>
  
  <pre><code>function(){
      $success=$this-&gt;query($query, $bindvalues);
  
      return ($success == true) ? $this-&gt;stmt-&gt;fetch(PDO::FETCH_ASSOC) : false;
  }
  </code></pre>
  
  <p>When I perform a select query that returns a row (or more), it will return for example:</p>
  
  <pre><code>array(1) { ["Id"]=&gt; string(1) "1" }
  </code></pre>
  
  <p>When the query fails (if I have a wrong syntax for example), it will return FALSE.</p>
  
  <p>But if no rows are found with the query it also returns FALSE.</p>
  
  <p>So the return value with an error in the query and with no rows will both return FALSE. How is that possible? I need to return FALSE only when there is an error in the query, and I need to return NULL for example when there are no results. Is there something wrong in my function?</p>
  
  <p>Thanks!</p>