title: PDO view insert details of query
body: <p>I am inserting some data in to a table, and I need to get the id of that query to insert in to another query straight after that query.</p>
  
  <pre><code>$database = DatabaseFactory::getFactory()-&gt;getConnection();
  $addproduct = $database-&gt;prepare("INSERT INTO products(title, description, price,
      startingprice, buyitnow, itemcondition, shortdescription, enddate, offers, 
      location, shipping, quantity, date, username) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
  $result = $addproduct-&gt;execute(array($title, $maindescription, $price, $startingprice,
      $type, $condition, $shortdescription, $enddate, $offers, $country,
      $shipping, $quantity, date("Y-m-d: H:i:s"), $user-&gt;username));
  
  print_r($result);
  
  if($result):
      //add bid for min price to stop fetching every second
      $addbid = $database-&gt;prepare("INSERT INTO bids(bids_amount,bids_timestamp, bids_username, bids_item) VALUES(?,?,?,?)");
      $addbid-&gt;execute(array($price, strtotime("NOW"), $user-&gt;username, $result-&gt;id));
      return 2;
  else:
      return 3;
  endif;
  </code></pre>
  
  <p>As you can see i am trying to get the id of the last query and insert that into my second query in to 'bids_items'.</p>
  
  <p>How can I get an array of the data I insert in my first query?</p>