okami
okami

Reputation: 2153

Get autoincrement id after an insert query performed

I want to get the autoincrement id of an insert.

is there a way to do it?

Upvotes: 1

Views: 1319

Answers (1)

Pekka
Pekka

Reputation: 449823

Seeing as you're specifying only mySQL in your tags:

Use LAST_INSERT_ID(). Make sure to read the manual page for the subtleties.

The language you are querying mySQL from may have built-in API functions that do the same thing.

Upvotes: 7

Related Questions