title: how to select last autoincrement id using php and mysql
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/897356/php-mysql-insert-row-then-get-id">php/MySQL insert row then get &#39;id&#39;</a>  </p>
  </blockquote>
  
  
  
  <p>I have an inset command such as</p>
  
  <pre><code>insert (name) values($name);
  </code></pre>
  
  <p>I have id column as autoincrement. How can I get the id of the inserted record <em>after</em> inserting.</p>