title: PHP/MySQL Get autoincremented value after insert
body: <p>In my mysql table i have an id-column which is set to autoincrement.</p>
  
  <p>then i do queries like this:</p>
  
  <p>INSERT INTO table (id, foo) VALUES ('', 'bar')</p>
  
  <p>how can i then safely find out which id was generated with this insert?</p>
  
  <p>if i just query the last id this might not be safe, since another insert could have happened in the meantime, right?</p>