title: SELECT is empty after INSRET using PDO
body: <p>I have a PHP-script which can be called with parameters. 
  If called without parameter it will show some data from DB.
  If called with parameter "add" it will add somedata to db and then it should call same query as above and show data from db - but it does not!</p>
  
  <p>No persinstent connection, no transactions used.</p>
  
  <p>If parameter  "delete" ist used, it works like it should.</p>
  
  <p>Also strange, values are inserted correctly into db. If I run the script second time without parameter "action", then previously inserted values are shown. Insert-query seems to work correct.</p>
  
  <p>For me it looks like there is a transaction not fully finished, but query on new datasets are already running while datarows/tables are still blocked.</p>
  
  <p>Any Ideas?</p>
  
  <pre class="lang-php prettyprint-override"><code>if (isset($_GET['action'])) {
      if($_GET['action'] == 'add'){
          if (isset($_GET['propid'])) {
              $query = "SELECT id as property_id, name, enumtype, openentries, required FROM properties WHERE id = :prop_id";
              $params = array();
              $params[] = array(':prop_id', $_GET['propid'], 'int');
              $db-&gt;query($query, $params);
              $property = $db-&gt;fetch();
  
              // Assign property to categeory
              $query = "INSERT INTO categories_properties(cat_id, property_id, required) VALUES (:cat_id, :prop_id, :req)";
              $params = array();
              $params[] = array(':cat_id', $catid, 'int');
              $params[] = array(':prop_id', $_GET['propid'], 'int');
              $params[] = array(':req', $property['required'], 'int');
              $db-&gt;query($query, $params);
              $success = $db-&gt;result();
          }
      }elseif($_GET['action'] == 'delete'){
          if (isset($_GET['propid'])) {
              // Assign property to categeory
              $query = "DELETE FROM categories_properties WHERE cat_id = :cat_id AND property_id = :prop_id";
              $params = array();
              $params[] = array(':cat_id', $catid, 'int');
              $params[] = array(':prop_id', $_GET['propid'], 'int');
              $db-&gt;query($query, $params);
          }
      }
  
  }
  
  
  // Get assigned properties
  $query = "SELECT cp.cat_id cat_id, cp.property_id property_id, cp.required required, p.name property_name, p.enumtype property_enum, c.cat_name cat_name FROM (categories_properties cp INNER JOIN properties p ON (cp.property_id = p.id)) LEFT OUTER JOIN categories c ON (cp.cat_id = c.cat_id) WHERE cp.cat_id = :cat_id";
  $params = array();
  $params[] = array(':cat_id', $catid, 'int');
  $db-&gt;query($query, $params);
  
  $cat_properties = array();
  while ($row = $db-&gt;fetch()) {
      $cat_properties[] = $row;
  }
  
  print_r($cat_properties); // &lt;&lt;&lt; empty if action == add, correct if action == delete or action not set
  
  </code></pre>