title: (mysql, php) How to get auto_increment field value before inserting data?
body: <p>I'm uploading image file to storage server. Before uploading I should compose filename, which contains AUTOINCREMENT VALUE in it (for example, 12345_filename.jpg).</p>
  
  <p>How could I get autoincrement value before inserting into DB?</p>
  
  <p>I see only one solution</p>
  
  <ol>
  <li>insert empty row</li>
  <li>get it's autoincrement value</li>
  <li>delete this row</li>
  <li>insert row with real data using autoincrement value from p.1</li>
  </ol>
  
  <p>Is there any other solutions?</p>
  
  <p>Thank you</p>