title: Php PDO multiple prepare statements in transaction
body: <p>I have this code:</p>
  
  <pre><code>    $this-&gt;db-&gt;beginTransaction();
      $query = 'INSERT INTO `table1` VALUES (NULL,:a,:b,NULL,NOW())';
      $sth = $this-&gt;db-&gt;prepare($query);
      foreach ($values as $k =&gt; $v) {
        $sth-&gt;bindParam(':' . $k, $v, PDO::PARAM_INT);
      }
  
      $this-&gt;executeQueryRollbackOnException($sth, 'Message_1');
      $resetId = $this-&gt;db-&gt;lastInsertId();
  
      $query = 'UPDATE `table2` SET c=:c,d=:d WHERE reset_id IS NULL';
      $sth = $this-&gt;db-&gt;prepare($query);
      foreach ($values2 as $k =&gt; $v) {
        $sth-&gt;bindParam(':' . $k, $v, PDO::PARAM_INT);
      }
  
  
      $this-&gt;executeQueryRollbackOnException($sth, 'Message_2');
  
      Zend_Debug::dump($sth-&gt;rowCount(), 'Affected'); // This is 0
  
      // Commit
      $this-&gt;db-&gt;commit();    
  </code></pre>
  
  <p>...</p>
  
  <pre><code>  private function executeQueryRollbackOnException($sth, $message) {
      try {
        $sth-&gt;execute();
      } catch (Exception $e) {
        $this-&gt;logSQLError($e);
        $this-&gt;db-&gt;rollBack();
        throw new Exception($message);
      }
    }
  </code></pre>
  
  <p>First query is executed but the second is not. No mysql error produced. Any ideas ?</p>