Mike Shannon - SQL / Database http://www.mikeshannon.com/taxonomy/term/12/0 en How to get the last created auto-increment ID from a MySQL table http://www.mikeshannon.com/get-last-created-auto-increment-id-mysql-table <p>If you&rsquo;re like me then you&rsquo;re developing like crazy.&nbsp; Once in a while you may need to retrieve the auto-increment ID value from the last created row you inserted into a particular mysql table.&nbsp; Yea&hellip; when you insert a new row into a mysql table there is no apparent way to just return the ID from the row&rsquo;s auto-increment field.&nbsp; So to do this using PHP, simply use the</p> <p><a href="http://us.php.net/mysql_insert_id">mysql_insert_id()</a></p> <p>functin, which will return the last created ID as an interger.</p> <p><a href="http://www.mikeshannon.com/get-last-created-auto-increment-id-mysql-table" target="_blank">read more</a></p> http://www.mikeshannon.com/get-last-created-auto-increment-id-mysql-table#comments How To SQL / Database Fri, 10 Apr 2009 01:01:30 +0000 admin 92 at http://www.mikeshannon.com