View Full Version : getting the id of the last record created?


hdshngout
08-28-2005, 03:16 AM
Is there any way to get the id of the last record entered into your mysql database?

bejayel
08-28-2005, 08:35 AM
This is why i autoid stuff. The last record created should be at the bottom.

Lady Serena
08-28-2005, 10:49 PM
To get the ID of the last record that was inserted, use "SELECT LAST_INSERT_ID()" after adding the new row.

You can read more about it here: http://dev.mysql.com/doc/mysql/en/getting-unique-id.html