title: PDO lastInsertID() failing due to running multiple queries in a single call
body: <p>This is odd. I'm running a query with just a single INSERT, preceded by a SET statement. The query looks something like this:</p>
  
  <pre><code>SET @discount:=(SELECT discount * :applyDiscount FROM fra_cus WHERE customerID=:customerID AND franchiseID=:franchiseID);
  
  INSERT INTO discounts_applied (unitID, franchiseID, customerID, amount)
      VALUES(:unitID, :franchiseID, :customerID, @discount * :price);
  </code></pre>
  
  <p>It appears that if I prepare these as two separate PDO queries, lastInsertID() works fine... but if I prepare them and execute them in the same statement, lastInsertID() returns nothing.</p>
  
  <p>It's not the end of the world, but it's annoying. Anyone know why this would be the case? For the record, there's a reason I need to define @discount as a variable (pertains to triggers on one of the tables). Also this is all taking place within a larger transaction.</p>