title: PHP PDO fetch error. rowcount = 1 but fetchall returns false;
body: <p>i ave been having trouble with a simple select sql query.
  using php PDO.</p>
  
  <p>for some reason the rowcount returns 1 but fetch and fetchall both return false;
  to me that means the execute failed or the query returned no results which would have a rowcount of 0. my sql syntax as far as i can tell is fine.</p>
  
  <p>here is the sql query</p>
  
  <pre><code>SELECT * FROM CustomerAddress WHERE ".CustomerAddress::custAddressID." = :".CustomerAddress::custAddressID." LIMIT 1
  </code></pre>
  
  <p>here is the code.</p>
  
  <pre><code>try{
          if($this-&gt;selectCustomerAddressStatement-&gt;execute(array(CustomerAddress::custAddressID =&gt; $addressID)))
          {
              if($this-&gt;selectCustomerAddressStatement-&gt;rowCount() == 1)
              {   
                  $this-&gt;selectCustomerAddressStatement-&gt;closeCursor();
                  if($temp = $this-&gt;selectCustomerAddressStatement-&gt;fetch())
                  {
                      $customerAddress = new CustomerAddress($temp);
                      if($customerAddress-&gt;getCustAddressID() == $addressID)
                      {
                          return $customerAddress;
                      }else{
                          throw new Exception("The Customer Address Retrieved was not what was Asked.");
                      }
                  }else{
                      throw new Exception("Failed to retrieve Result set.");
                  }
              }else{
                  throw new Exception("Statement Returned To Many Results.");
              }
          }else{
              throw new Exception("Failed to Execute Statement.");
          }
      }catch(Exception $e) {
          $this-&gt;selectCustomerAddressStatement-&gt;closeCursor();
          throw new Exception("Customers:: selectCustomerAddress - ".$e-&gt;getMessage());
      }
  </code></pre>