title: How to get last id insertion with MySQL
body: <p>I try to insert 2 rows in database, second row needing auto increment id of first row.
  I've test with <code>LAST_INSERT_ID()</code> but I have a <code>MysqlIntegrityConstraintViolationException</code> : </p>
  
  <p><code>Cannot add or update a child row : a foreign key constraint fails ('customer_user_role', CONSTRAINT 'fk_customer_user_role_customer_id' FOREIGN KEY ('customer_user_role_id') REFERENCES 'customer' ('customer_id') ON DELETE NO ACTION ON UPDATE NO ACTION)</code></p>
  
  <p>My SQL request are :</p>
  
  <p><code>sqlu"INSERT INTO customer (name, email, phone, isActivated) VALUES ($name, $email, $phoneNumber, $isActivated)"</code></p>
  
  <p><code>sqlu"INSERT INTO customer_user_role (customer_id, user_id, customer_roletype_id) VALUES (LAST_INSERT_ID(), $userId, $roleTypeId)"</code></p>
  
  <p>(I work width Play &amp; Slick so that's why particular syntax)</p>
  
  <p>When I execute this on PhpMyAdmin it show me the same error, I don't know how to proceed...</p>