title: How to get the id of a row i've just inserted php/mysql
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1685860/php-how-to-get-last-inserted-id-of-a-table">PHP: how to get last inserted ID of a table?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm writing a function to add data do a database, but I then want to immediately use that entry in my code.</p>
  
  <p>I know I could query: SELECT id FROM table ORDER BY id DESC</p>
  
  <p>But I wonder if there's any more direct way of doing it.</p>